OFFSET
1,22
COMMENTS
The search radius for k is effectively limited to k<=n+1 because the subtracted term n^k has exponential growth and the added term k^(n+1) only polynomial growth as k increases. - R. J. Mathar, Sep 07 2014
LINKS
Juri-Stepan Gerasimov, Table of n, a(n) for n = 1..78
MAPLE
A245811 := proc(n)
local a, k, p ;
a := 0 ;
for k from 2 to n+1 do
p := k^(n+1)-n^k ;
if isprime(p) then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A245811(n), n=1..120) ; # R. J. Mathar, Sep 07 2014
PROG
(PARI) a(n) = if(n==1, return(1)); my(k=2, c=0, t); while((t=k^(n+1)-n^k)>0, k++; if(isprime(t), c++)); c
vector(80, n, a(n)) \\ Colin Barker, Aug 26 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 22 2014
STATUS
approved