%I #31 Jan 02 2023 12:30:52
%S 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,
%T 19,36,31,48,29,40,21,20,33,34,45,38,39,46,63,44,43,24,17,42,47,58,49,
%U 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
%N a(n)^2 + a(n+1) is prime; lexicographically earliest sequence of nonnegative integers with this property and containing no duplicates.
%C Conjectured to be a permutation of the nonnegative integers.
%C Terms are of alternating parity.
%C 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.
%C 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
%H Zak Seidov, <a href="/A268630/b268630.txt">Table of n, a(n) for n = 0..50000</a>
%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2016-February/016094.html">A formula for a permutation</a>, SeqFan list, Feb. 9, 2016.
%t 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 *)
%o (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))}
%Y Cf. A268494, A268495, A268496, A268497 for records and late birds.
%K nonn
%O 0,2
%A _Eric Angelini_ and _M. F. Hasler_, Feb 09 2016