%I #33 May 17 2014 02:57:36
%S 2,3,0,3,0,4,0,4,0,7,0,8,0
%N Least number k such that k^n + (k-1)^n + ... + 3^n + 2^n is prime, or 0 if no such k exists.
%C For n < 200, it is known that a(16) = 16, a(24) = 911, a(32) = 256, a(36) = 911, a(42) = 259, a(48) = 36, a(56) = 11, a(60) = 404, a(66) = 47, a(72) = 29527, a(80) = 83, a(108) = 4, a(110) = 12, a(120) = 12, a(144) = 4, and a(192) = 6631.
%C Let S = k^n + (k-1)^n + ... + 3^n + 2^n. For any n, if k == 1 mod 4 or 2 mod 4, then 2|S. Thus, if a(n) is not 0, then a(n) must be congruent to 3 mod 4 or 0 mod 4.
%C For odd n and for any k > 3, gpf(k-1)|S, where gpf(x) is the greatest prime factor of x. If k = 3, 3^n + 2^n is always divisible by 5. Thus, a(n) = 0 if n is odd (except a(1) = 2).
%C For even n < 100, if a(n) was not specified above, a(n) > 100000 or 0.
%C For even n between 100 and 200 inclusively, if a(n) was not specified above, a(n) > 50000 or 0.
%e 2^6 = 64 is not prime. 3^6 + 2^6 = 793 is not prime. 4^6 + 3^6 + 2^6 = 4889 is prime. Thus, a(6) = 4.
%o (PARI) for(k=1,50000,if(ispseudoprime(sum(i=2,k,i^n)),return(k)))
%o n=1;while(n<100,print(a(n));n+=1)
%K nonn,hard,more
%O 1,1
%A _Derek Orr_, Apr 15 2014
|