PolymathREU-Walking-to-infi.../java/append_primes/Main.java

25 lines
689 B
Java
Raw Normal View History

2020-07-19 17:16:53 -07:00
package append_primes;
2020-07-13 09:06:43 -07:00
import java.util.ArrayList;
public class Main
{
public static void main(String[] args)
{
Util.init();
2020-07-19 17:16:53 -07:00
/* By changing the args[0] we can modify which prime we want to be the
* first in the row. Same for the number of iteration.
*/
Tree tree = new Tree(Integer.parseInt(args[0]), new ArrayList<Long>());
for (int i = 0; i < Integer.parseInt(args[1]); i++) {
2020-07-19 18:36:50 -07:00
/* Optimied the output */
int temp = tree.longestPath().size();
2020-07-13 09:06:43 -07:00
tree.step();
2020-07-19 18:36:50 -07:00
if(tree.longestPath().size() != temp){
Util.printList(tree.longestPath());
}
2020-07-13 09:06:43 -07:00
}
}
}