login
A343932
a(n) = (Sum_{k=1..n} k^k) mod n.
1
0, 1, 2, 0, 3, 5, 5, 4, 1, 7, 3, 4, 11, 13, 3, 4, 0, 15, 0, 4, 14, 13, 10, 20, 22, 11, 25, 20, 21, 1, 18, 4, 6, 17, 27, 12, 31, 27, 20, 28, 6, 41, 34, 32, 31, 45, 45, 4, 11, 25, 39, 48, 21, 45, 46, 12, 53, 47, 41, 32, 9, 5, 55, 4, 25, 7, 47, 8, 45, 19, 12, 60, 50, 43, 20, 60, 54, 29, 72, 36, 70, 31, 74, 40, 69, 7, 18, 20, 63, 3, 24, 32
OFFSET
1,3
LINKS
FORMULA
a(n) = A001923(n) mod n.
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;
(Python)
def A343932(n): return sum(pow(k, k, n) for k in range(1, n+1)) % n # Chai Wah Wu, Jun 18 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, May 04 2021
STATUS
approved