login
Smallest k such that n + k and n^2 + k^2 are simultaneously primes.
1

%I #18 Feb 27 2018 03:01:24

%S 1,1,2,1,2,1,10,3,4,1,6,7,10,9,2,1,2,5,10,3,10,15,8,5,4,5,2,13,30,11,

%T 6,5,8,9,2,1,30,3,34,1,20,5,10,9,2,15,20,13,4,11,16,7,20,25,4,11,2,3,

%U 14,13,10,17,38,9,2,1,22,5,10,3,26,7,28,5,4,21,12

%N Smallest k such that n + k and n^2 + k^2 are simultaneously primes.

%H Bill McEachen, <a href="/A071559/b071559.txt">Table of n, a(n) for n = 1..1000</a>

%t Table[SelectFirst[Range[120], AllTrue[{n + #, n^2 + #^2}, PrimeQ] &], {n, 77}] (* _Michael De Vlieger_, Feb 22 2018 *)

%o (PARI) for(n=1,100,s=1; while(isprime(s^2+n^2)*isprime(s+n)==0,s++); print1(s,","))

%K easy,nonn

%O 1,3

%A _Benoit Cloitre_, May 30 2002