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”).
%I #29 Apr 15 2014 02:58:00
%S 1,2,2,0,0,4,5,0,0,10,27,0,0,13,18,0,0,26,57,0,0,16,35,0,0,219,19,0,0,
%T 373,48,0,0,35,33,0,0,94,93,0,0,225,47,0,0,47,223,0,0,3227,49,0,0,199,
%U 127,0,0,45,67,0,0,65,123,0,0,103
%N Least number k > 0 such that n^k - (n-1)^k - ... - 3^k - 2^k is prime, or 0 if no such k exists.
%C 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.
%C A prime number is in the sequence A000040.
%C Next term a(68) is most likely > 5000.
%e 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.
%o (PARI) a(n)=for(k=1,5000,if(ispseudoprime(n^k-sum(i=2,n-1,i^k)),return(k)));
%o n=1; while(n<100,print1(a(n), ", ");n+=1)
%Y Cf. A042963, A057468, A138699.
%K nonn,more
%O 2,2
%A _Derek Orr_, Apr 06 2014