OFFSET
2,2
COMMENTS
a(n) = 0 if and only if n == 1 or 2 mod 4. This is because of the parity of the number given. For n = 1, 2, 5, 6, 9, 10, 13, 14,... any k-value will return an even number. Thus, it will never be prime. The only exception is for n = 1, where it will return 1, still not a prime. Further when n = 2, it only returns even numbers; however, 2 is a prime and thus, a(2) = 1.
A prime number is in the sequence A000040.
Next term a(68) is most likely > 5000.
EXAMPLE
7^1 - 6^1 - 5^1 - 4^1 - 3^1 - 2^1 = -13 is not prime. 7^2 - 6^2 - 5^2 - 4^2 - 3^2 - 2^2 = -41 is not prime. 7^3 - 6^3 - 5^3 - 4^3 - 3^3 - 2^3 = -97 is not prime. 7^4 - 6^4 - 5^4 - 4^4 - 3^4 - 2^4 = 127 is prime. Thus, a(7) = 4.
PROG
(PARI) a(n)=for(k=1, 5000, if(ispseudoprime(n^k-sum(i=2, n-1, i^k)), return(k)));
n=1; while(n<100, print1(a(n), ", "); n+=1)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Derek Orr, Apr 06 2014
STATUS
approved