login
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