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”).
%I #19 Mar 12 2021 09:48:38
%S 1,2,3,5,5,13,7,21,25,41,11,135,13,113,271,297,17,875,19,1573,1765,
%T 1145,23,9215,2521,4265,13627,18539,29,71371,31,67729,119329,65825,
%U 76931,637061,37,262505,1064935,1381637,41,4432817,43,4207855,11169629,4194833,47
%N a(n) = Sum_{k=1..n} (n/gcd(k,n))^(gcd(k,n) - 1).
%H Seiichi Manyama, <a href="/A342421/b342421.txt">Table of n, a(n) for n = 1..5000</a>
%F a(n) = Sum_{d|n} phi(d^(n/d)) = Sum_{d|n} phi(d) * d^(n/d-1).
%F If p is prime, a(p) = p.
%t a[n_] := Sum[(n/GCD[k, n])^(GCD[k, n] - 1), {k, 1, n}]; Array[a, 50] (* _Amiram Eldar_, Mar 11 2021 *)
%o (PARI) a(n) = sum(k=1, n, (n/gcd(k, n))^(gcd(k, n)-1));
%o (PARI) a(n) = sumdiv(n, d, eulerphi(d^(n/d)));
%o (PARI) a(n) = sumdiv(n, d, eulerphi(d)*d^(n/d-1));
%Y Cf. A000010, A342422.
%K nonn
%O 1,2
%A _Seiichi Manyama_, Mar 11 2021