login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A242552 Least number k such that n^4+k^4 is prime. 0

%I #5 May 17 2014 12:43:54

%S 1,1,2,1,2,1,2,3,2,7,2,13,4,5,8,1,2,5,2,1,10,15,2,1,6,3,2,1,12,7,12,5,

%T 14,1,6,7,2,3,14,9,2,5,10,21,2,1,4,1,2,7,2,11,6,1,14,1,2,7,2,11,2,11,

%U 8,23,16,29,12,3,10,27,2,5,8,1,8,3,20,17,2,1,10,1,10

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

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

%e 8^4+1^4 = 4097 is not prime. 8^4+2^4 = 4112 is not prime. 8^4+3^4 = 4177 is prime. Thus, a(8) = 3.

%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**4+k**4):

%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^4+k^4),return(k)));

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

%Y Cf. A069003, A000068.

%K nonn

%O 1,3

%A _Derek Orr_, May 17 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 18 16:14 EDT 2024. Contains 375269 sequences. (Running on oeis4.)