login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A242552
Least number k such that n^4 + k^4 is prime.
0
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, 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, 8, 23, 16, 29, 12, 3, 10, 27, 2, 5, 8, 1, 8, 3, 20, 17, 2, 1, 10, 1, 10
OFFSET
1,3
COMMENTS
If a(n) = 1, then n is in A000068.
EXAMPLE
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.
PROG
(Python)
import sympy
from sympy import isprime
def a(n):
for k in range(10**4):
if isprime(n**4+k**4):
return k
n = 1
while n < 100:
print(a(n))
n += 1
(PARI) a(n)=for(k=1, oo, if(ispseudoprime(n^4+k^4), return(k)));
CROSSREFS
Sequence in context: A373461 A257806 A035391 * A249717 A249718 A244518
KEYWORD
nonn
AUTHOR
Derek Orr, May 17 2014
STATUS
approved