A272878 a(0) = a(1) = 1, smallest a(n+1) > a(n-1) such that a(n)^2 + a(n+1)^2 is prime.
1, 1, 2, 3, 8, 5, 16, 9, 26, 11, 30, 13, 32, 15, 34, 21, 44, 29, 46, 39, 50, 43, 60, 61, 64, 71, 66, 79, 74, 81, 100, 83, 102, 95, 104, 101, 114, 109, 134, 115, 136, 135, 146, 139, 154, 141, 160, 143, 168, 155, 172, 165, 178, 173, 190, 177, 200, 189, 206, 199
Offset: 0
Links
- Amiram Eldar, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
a[0]=1; a[1]=1; a[n_]:=a[n]= Block[{t = a[n-2] + 1}, While[! PrimeQ[t^2 + a[n-1]^2], t++]; t]; Array[a, 80, 0] (* Giovanni Resta, May 08 2016 *)
-
PARI
lista(nn) = {print1(x = 1, ", "); print1(y = 1, ", "); for (n=2, nn, z = x+1; while (! isprime(y^2+z^2), z++); print1(z, ", "); x = y; y = z;);} \\ Michel Marcus, May 08 2016
Extensions
More terms from Michel Marcus, May 08 2016
Comments