%I #29 May 17 2024 09:56:14
%S 1,2,6,42,1806
%N Numbers m such that k^m + (k+1)^m + ... + (k+m-1)^m is prime for some k.
%C a(5) > 500. For m values < 500 not listed above, k has been checked for k <= 5000.
%C For the first four terms, the least k that makes k^m + (k+1)^m + ... + (k+m-1)^m prime is {2, 1, 4, 99} respectively.
%C For a(5) = 1806, k = 3081 yields a strong PRP with 6663 digits. - _Don Reble_, Mar 23 2018
%C The known terms a(1..5) coincide with the finite sequence A014117. - _M. F. Hasler_, May 20 2019
%e k^1 = k is prime for k = 2 or any other prime (cf. A000040), so 1 is a term of this sequence.
%e k^2 + (k+1)^2 is prime for some k (e.g., k = 2 yields 13, see A027861 for the full list), so 2 is a term of this sequence.
%e k^3 + (k+1)^3 + (k+2)^3 = 3*(k+1)*(k^2+2*k+3) is never prime, therefore 3 is not a term of this sequence.
%e Similarly, the corresponding expression for m = 4 and m = 5 is a multiple of 2 and 5, respectively, and for all m = 7, ..., 41, the expression also shares a factor with m (and thus is a multiple of m whenever m is prime).
%e Index m = 110 is the smallest m > 42 for which the expression is not algebraically composite (the polynomial in k has content 1 and is irreducible over Q), but it does factor as (k(k+1)(k+2)(k+3)(k+4))^10 over Z_5, so is always a multiple of 5. Index m = 210 is the next one which is a similar case.
%e Index m = 231 is much like m = 110, but with a factor 7 instead of 5.
%e Index m = 330 again yields an irreducible polynomial with content 1, but as before one can show that it is always divisible by 5. And so on.
%o (PARI) k(n)=for(k=1,5000,if(ispseudoprime(sum(i=0,n-1,(k+i)^n)),return(k)))
%o for(n=1,500,if(k(n),print(n))) \\ Edited by _M. F. Hasler_, Mar 23 2018
%Y Cf. A000040, A027861, A014117.
%K nonn,hard,more
%O 1,2
%A _Derek Orr_, May 26 2014
%E a(5) from _Don Reble_, Mar 23 2018
%E Example corrected and extended by _M. F. Hasler_, Apr 05 2018