If 2n+1 is 1 or a prime, set a(n) = 2n+1. If no prime is ever reached, set a(n) = -1.
Comment from Klaus Brockhaus, Aug 01 2007:
"The sequence, starting from the beginning but writing 0 when a number with more than 90 digits is reached, is:
Contribution from Andrew Carter (acarter09(AT)newarka.edu), Dec 16 2008: (Start)
If this sequence were to do all terms, all even terms except 2 and 4 would be -1:
a simple proof is that an even number's smallest proper divisor is 2,
all even numbers except 2 and 4 have factors in front so the resulting number would be 10n+2 and n is an integer greater than 1,
and therefore an even number endng in 2 other than two - rinse and repeat (End)