login
A284047
a(n) is the smallest positive integer not already in the sequence such that a(n) + a(n-1) and a(n)^2 + a(n-1)^2 are primes, with a(1) = 1.
1
1, 2, 3, 8, 5, 6, 11, 20, 23, 18, 35, 24, 19, 10, 7, 12, 17, 42, 25, 4, 9, 14, 15, 22, 57, 32, 27, 52, 37, 30, 13, 28, 33, 40, 39, 34, 45, 16, 31, 70, 69, 80, 21, 26, 41, 56, 51, 50, 53, 48, 65, 36, 71, 60, 29, 44, 59, 54, 85, 46, 81, 100, 49, 90, 61, 76, 91, 66, 101, 96, 55, 58, 73, 108, 43, 120, 79, 84, 145, 78, 103
OFFSET
1,2
COMMENTS
Conjectured to be a permutation of the natural numbers.
EXAMPLE
a(4) = 8 because 1, 2 and 3 have already been used in the sequence, 3 + 4 = 7 is a prime but 3^2 + 4^2 = 25 is not prime, 3 + 5 = 8, 3 + 6 = 9, 3 + 7 = 10 are not primes while 3 + 8 = 11 is a prime and 3^2 + 8^2 = 73 is a prime also.
MATHEMATICA
f[s_List] := Block[{k = 1, a = s[[-1]]}, While[MemberQ[s, k] || ! (PrimeQ[a + k] && PrimeQ[a^2 + k^2]), k++]; Append[s, k]]; Nest[f, {1}, 80]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Mar 19 2017
STATUS
approved