login
A343931
Numbers k such that Sum_{j=1..k} (-j)^j == 0 (mod k).
2
1, 3, 4, 11, 131, 188, 324, 445, 3548, 8284, 201403, 253731, 564084, 1812500, 4599115
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
A343931_list = list(islice(A343931_gen(), 10)) # Chai Wah Wu, Jun 18 2022
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