OFFSET
1,2
COMMENTS
a(20) > 10^7. - Hiroaki Yamanouchi, Aug 25 2015
MAPLE
a:=0:
for n from 1 to 2000 do
a:=a+n^n:
if a mod n=0 then
print(n);
fi;
od: # Revised program from R. J. Mathar, Jun 18 2015
MATHEMATICA
f=0; Do[ f=f+k^k; If[ IntegerQ[f/k], Print[k] ], {k, 1, 6639} ]
PROG
(PARI) for(n=1, 10^4, s=sum(i=1, n, Mod(i, n)^i); if(!Mod(s, n), print1(n, ", "))) \\ Derek Orr, Jun 18 2015
(Python)
from itertools import accumulate, count, islice
def A128981_gen(): # generator of terms
yield 1
for i, j in enumerate(accumulate(k**k for k in count(1)), start=2):
if j % i == 0:
yield i
CROSSREFS
KEYWORD
hard,more,nonn
AUTHOR
Alexander Adamchuk, Apr 29 2007
EXTENSIONS
a(11) and a(12) from Jon E. Schoenfield, May 09 2007
a(13) = 376636 from Alexander Adamchuk, May 03 2010
a(14)-a(16) from Lars Blomberg, May 10 2011
a(17) from Giovanni Resta, Jul 13 2015
a(18)-a(19) from Hiroaki Yamanouchi, Aug 25 2015
STATUS
approved