login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A268630
a(n)^2 + a(n+1) is prime; lexicographically earliest sequence of nonnegative integers with this property and containing no duplicates.
5
0, 2, 1, 4, 3, 8, 7, 10, 9, 16, 13, 12, 5, 6, 11, 18, 23, 28, 25, 22, 15, 14, 27, 32, 37, 30, 19, 36, 31, 48, 29, 40, 21, 20, 33, 34, 45, 38, 39, 46, 63, 44, 43, 24, 17, 42, 47, 58, 49, 66, 35, 52, 73, 64, 57, 50, 51, 56, 55, 54, 41, 60, 59, 76, 67, 72, 53, 70, 69, 26, 75, 68, 79, 82, 99, 86, 61, 100, 91, 88, 85, 84, 65, 102, 83, 78, 89, 90, 71, 106, 81
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
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
Cf. A268494, A268495, A268496, A268497 for records and late birds.
Sequence in context: A294022 A076077 A152194 * A087787 A182712 A100818
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Feb 09 2016
STATUS
approved