OFFSET
0,2
COMMENTS
Conjectured to be a permutation of the nonnegative integers.
Terms are of alternating parity.
The sequence cannot have a fixed point other than a(0)=0 because for n>0, the terms are of parity opposite to that of their indices.
The number of distinct m-digit primes arising from the sequence appears to be bounded by the entries of A030186. The counts here for m=1 to 9 are 2,7,21,69,216,684,2162,6801,21623 compared to A030186's 2,7,22,71,228,733,2356,7573,24342. - Bill McEachen, Feb 15 2016
LINKS
Zak Seidov, Table of n, a(n) for n = 0..50000
E. Angelini, A formula for a permutation, SeqFan list, Feb. 9, 2016.
MATHEMATICA
s = {0, 2, 1, 4}; a = 4; Do[b = Mod[a, 2] + 3; While[MemberQ[s, b] || ! PrimeQ[a^2 + b], b = b + 2]; AppendTo[s, b]; a = b, {1000}]; s (* Zak Seidov, Feb 09 2016 *)
PROG
(PARI) {u=[a=0]; for(n=1, 99, for(k=1, 9e9, setsearch(u, k)&&next; isprime(a*a+k)||next; print1(k", "); u=setunion(u, [a=k]); break))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Feb 09 2016
STATUS
approved