OFFSET
1,2
COMMENTS
Also numbers k such that k divides A001099(k).
MATHEMATICA
q[n_] := Divisible[Sum[PowerMod[-k, k, n], {k, 1, n}], n]; Select[Range[8500], q] (* Amiram Eldar, May 04 2021 *)
PROG
(PARI) isok(n) = sum(k=1, n, Mod(-k, n)^k)==0;
(Python)
from itertools import accumulate, count, islice
def A343931_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
nonn,more
AUTHOR
Seiichi Manyama, May 04 2021
EXTENSIONS
a(11)-a(13) from Chai Wah Wu, May 04 2021
a(14) from Martin Ehrenstein, May 05 2021
a(15) from Martin Ehrenstein, May 08 2021
STATUS
approved