A268630 a(n)^2 + a(n+1) is prime; lexicographically earliest sequence of nonnegative integers with this property and containing no duplicates.
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
Keywords
Links
- Zak Seidov, Table of n, a(n) for n = 0..50000
- E. Angelini, A formula for a permutation, SeqFan list, Feb. 9, 2016.
Programs
-
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 *)
-
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))}
Comments