login
Least number k such that k^32+n^32 is prime.
1

%I #7 Apr 26 2018 12:11:23

%S 1,29,40,33,34,131,50,9,8,11,10,13,12,97,166,221,200,13,10,61,176,23,

%T 22,65,94,151,352,87,2,1,38,39,4,5,48,137,18,11,4,3,60,55,40,9,106,33,

%U 10,29,134,7,44,33,50,1,38,5,148,37,2,41,10,11,94,75,4,5,100,5,22

%N Least number k such that k^32+n^32 is prime.

%C If a(n) = 1, then n is in A006315.

%t lnk[n_]:=Module[{k=1,n32=n^32},While[!PrimeQ[n32+k^32],k++];k]; Array[ lnk,70] (* _Harvey P. Dale_, Apr 26 2018 *)

%o (Python)

%o import sympy

%o from sympy import isprime

%o def a(n):

%o ..for k in range(10**4):

%o ....if isprime(n**32+k**32):

%o ......return k

%o n = 1

%o while n < 100:

%o ..print(a(n))

%o ..n += 1

%o (PARI) a(n)=for(k=1,10^3,if(ispseudoprime(n^32+k^32),return(k)));

%o n=1;while(n<100,print(a(n));n+=1)

%Y Cf. A069003, A006315.

%K nonn

%O 1,2

%A _Derek Orr_, May 17 2014