OFFSET
1,1
COMMENTS
This sequence is similar to A094756 but seems to have a simpler periodicity rules:
a(n)=3 when n=1 (mod 2), otherwise
a(n)=5 when n=2 (mod 4), otherwise
a(n)=7 when n=4*m (mod 12) for some m=1,2, otherwise
a(n)=11 when n=12*m (mod 60) for some m=1,2,3,4, otherwise
a(n)=17 when n=60*m (mod 240) for some m=1,2,3, otherwise
a(n)=19 when n=240*m (mod 720) for some m=1,2, otherwise
a(n)=23 when n=720*m (mod 7920) for some m=1,..,10, etc.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..100000
EXAMPLE
a(4) = 7 because k divides 1^4 + 2^4 +...+ k^4 for k=7 but no smaller k > 1.
MATHEMATICA
Table[k=2; s=0; While[s=s+(k-1)^n; Mod[s, k]>0, k++ ]; k, {n, 100}]
PROG
(PARI) A095366(n) = { my(k=1, s=0); while(1, k++; s += ((k-1)^n); if(!(s%k), return(k))); }; \\ Antti Karttunen, Dec 19 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Jun 03 2004
STATUS
approved