login
A342435
a(n) = Sum_{k=1..n} gcd(k,n)^(gcd(k,n) - 2).
1
1, 2, 5, 19, 129, 1303, 16813, 262166, 4782981, 100000133, 2357947701, 61917365564, 1792160394049, 56693912392115, 1946195068359645, 72057594038190124, 2862423051509815809, 121439531096599037355
OFFSET
1,2
FORMULA
a(n) = Sum_{d|n} phi(n/d) * d^(d-2).
MATHEMATICA
a[n_] := Sum[GCD[k, n]^(GCD[k, n] - 2), {k, 1, n}]; Array[a, 20] (* Amiram Eldar, Mar 12 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, gcd(k, n)^(gcd(k, n)-2));
(PARI) a(n) = sumdiv(n, d, eulerphi(n/d)*d^(d-2));
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Mar 12 2021
STATUS
approved