login
A342412
a(n) = Sum_{k=1..n} (n/gcd(k,n))^(n-2).
2
1, 2, 7, 37, 501, 2771, 100843, 1056833, 28702189, 401562757, 23579476911, 247792605523, 21505924728445, 340246521979079, 15569565432876147, 576478345026355201, 45798768824157052689, 728648310343004595593, 98646963440126439346903
OFFSET
1,2
FORMULA
a(n) = Sum_{d|n} phi(d^(n-1)) = Sum_{d|n} phi(d) * d^(n-2).
G.f.: Sum_{k>=1} phi(k^(k-1))*x^k/(1 - (k*x)^k).
MATHEMATICA
a[n_] := Sum[(n/GCD[k, n])^(n - 2), {k, 1, n}]; Array[a, 20] (* Amiram Eldar, Mar 11 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (n/gcd(k, n))^(n-2));
(PARI) a(n) = sumdiv(n, d, eulerphi(d^(n-1)));
(PARI) a(n) = sumdiv(n, d, eulerphi(d)*d^(n-2));
(PARI) my(N=20, x='x+O('x^N)); Vec(sum(k=1, N, eulerphi(k^(k-1))*x^k/(1-(k*x)^k)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Mar 11 2021
STATUS
approved