login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343933
a(n) = (Sum_{k=1..n} (-k)^k) mod n.
3
0, 1, 0, 0, 2, 5, 6, 4, 8, 7, 0, 4, 10, 3, 10, 4, 12, 15, 3, 4, 3, 19, 2, 20, 11, 3, 23, 16, 15, 1, 11, 4, 1, 9, 24, 12, 1, 11, 36, 28, 26, 41, 5, 12, 20, 45, 26, 4, 5, 35, 16, 32, 48, 45, 23, 44, 51, 23, 3, 32, 29, 25, 44, 4, 24, 19, 64, 56, 28, 29, 44, 60, 54, 71, 12, 24, 51, 65, 55, 36, 68, 21, 1, 40, 38
OFFSET
1,5
LINKS
MATHEMATICA
a[n_] := Mod[Sum[PowerMod[-k, k, n], {k, 1, n}], n]; Array[a, 100] (* Amiram Eldar, May 04 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-k)^k)%n;
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, May 04 2021
STATUS
approved