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”).

A342421
a(n) = Sum_{k=1..n} (n/gcd(k,n))^(gcd(k,n) - 1).
4
1, 2, 3, 5, 5, 13, 7, 21, 25, 41, 11, 135, 13, 113, 271, 297, 17, 875, 19, 1573, 1765, 1145, 23, 9215, 2521, 4265, 13627, 18539, 29, 71371, 31, 67729, 119329, 65825, 76931, 637061, 37, 262505, 1064935, 1381637, 41, 4432817, 43, 4207855, 11169629, 4194833, 47
OFFSET
1,2
LINKS
FORMULA
a(n) = Sum_{d|n} phi(d^(n/d)) = Sum_{d|n} phi(d) * d^(n/d-1).
If p is prime, a(p) = p.
MATHEMATICA
a[n_] := Sum[(n/GCD[k, n])^(GCD[k, n] - 1), {k, 1, n}]; Array[a, 50] (* Amiram Eldar, Mar 11 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (n/gcd(k, n))^(gcd(k, n)-1));
(PARI) a(n) = sumdiv(n, d, eulerphi(d^(n/d)));
(PARI) a(n) = sumdiv(n, d, eulerphi(d)*d^(n/d-1));
CROSSREFS
Sequence in context: A376017 A079024 A357000 * A319631 A097453 A079125
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Mar 11 2021
STATUS
approved