OFFSET
1,1
COMMENTS
EXAMPLE
1^4 - 1^3 + 1^2 - 1^1 + 1 = 1 is not prime. 2^4 - 2^3 + 2^2 - 2^1 + 1 = 11 is prime. Thus a(4) = 2.
PROG
(PARI) a(n)=for(k=1, 1000, s=k^n; if(ispseudoprime(s+sum(i=1, n, (-1)^i*k^(n-i))), return(k)))
n=1; while(n<100, print1(a(n), ", "); n+=1)
(PARI) A243160(n) = if(3!=n && !isprime(1+n), 0, my(s); for(k=1, oo, s=k^n; if(isprime(s+sum(i=1, n, (-1)^i*k^(n-i))), return(k)))); \\ Antti Karttunen, Jul 19 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, May 31 2014
STATUS
approved