OFFSET
1,3
COMMENTS
a(n) = 0 is definite. a(n) = 0 iff n = 4m^4 for m > 1. If n = 4m^4, 4m^4+k^4 = (2m^2+2mk+k^2)*(2m^2-2mk+k^2), meaning it is never prime. For m = 1, 2*1^2-2*1*k+k^2 = 2-2k+k^2 is 1 for k = 1. This is why a(4) = 1.
If n is in A006093 (a prime minus 1), then a(n) = 1 and the 3 primes of the definition coincide. - Michel Marcus, Jun 01 2014
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000
EXAMPLE
3+1, 3+1^2, and 3+1^3 are not prime. 3+2 (5), 3+2^2 (9), and 3+2^3 (11) are all prime. Thus a(3) = 2.
MATHEMATICA
f[n_] := If[n == 4 || !IntegerQ[(n/4)^(1/4)], Block[{k = 1}, While[ !PrimeQ[n + k] || !PrimeQ[n + k^2] || !PrimeQ[n + k^4], k++]; k], 0]; Array[ f, 70] (* Robert G. Wilson v, Jun 01 2014 *)
PROG
(PARI) a(n)=for(k=1, 10^6, if(ispseudoprime(n+k)&&ispseudoprime(n+k^2)&&ispseudoprime(n+k^4), return(k)))
n=1; while(n<100, print1(a(n), ", "); n+=1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, May 30 2014
EXTENSIONS
Definition corrected by N. J. A. Sloane, May 31 2014
STATUS
approved