OFFSET
1,1
COMMENTS
a(n) <= n+1 for all n.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
EXAMPLE
(2^2-8)/(2-8) = -4/-6 is not an integer. (3^3-8)/(3-8) = 19/-5 is not an integer. (4^4-8)/(4-8) = 248/4 = 62 is an integer. Thus a(8) = 4.
MATHEMATICA
a[n_] := Module[{k = 2}, While[k == n || ! Divisible[k^k - n, k - n], k++]; k]; Array[a, 100] (* Amiram Eldar, Jun 04 2021 *)
PROG
(PARI) a(n)=for(k=2, n+1, if(k!=n, s=(k^k-n)/(k-n); if(floor(s)==s, return(k))));
n=1; while(n<100, print(a(n)); n+=1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, May 22 2014
STATUS
approved