login
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

%I #7 Mar 22 2017 21:54:27

%S 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,

%T 27,52,37,30,13,28,33,40,39,34,45,16,31,70,69,80,21,26,41,56,51,50,53,

%U 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

%N 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.

%C Conjectured to be a permutation of the natural numbers.

%H Rémy Sigrist, <a href="/A284047/b284047.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e 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.

%t 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]

%Y Cf. A002313, A055265, A055266, A121878, A228730, A243625.

%K nonn

%O 1,2

%A _Ilya Gutkovskiy_, Mar 19 2017