2009-01-11, 11:36 PM
(This post was last modified: 2009-01-11, 11:38 PM by KajitiSouls.)
Code:
private static ArrayLists primeList (single numbers only), other lists of sets of primes.
public static void main(String[] args){
--Initialize the long nextPrime, to keep track of the new prime being checked every pass of the while(true) loop.
--Initialize any other stuff as necessary.
while(true){
--Find the next prime number in the sequence primeList. This is the new value of nextPrime.
--Use nextPrime and concatenate with existing sets of primes (sets of four primes, three, then two) to see if they make larger sets of primes.
--If a set of five primes is found, print out the results and return;
--If ANY of the primes fail to concatenate with nextPrime to make a new prime number, the test fails, and the computer moves to the next set of primes.
--If the set of primes passes the test, a new array for the larger set of primes is added to the corresponding ArrayList. The old set of primes stays put.
--Compare existing known primes with nextPrime to see if they make sets of two primes. This is pretty much the only reason why primeList exists.
}//end while(true) loop
}Stereo, why would you set numbers concatenated with themselves as true? They aren't primes for the very obvious reason that they have a factor that is the parent prime. Other than that, I might take a look into your idea.
Oh yeah, you might have noticed a time variable. On the output, it said "Time: 134.60858333333334 minutes."

