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

a(n) = Sum_{k=1..n} gcd(k,n)^(gcd(k,n) - 1).
4

%I #17 Mar 13 2021 10:05:10

%S 1,3,11,68,629,7791,117655,2097224,43046745,1000000637,25937424611,

%T 743008378618,23298085122493,793714773371811,29192926025391919,

%U 1152921504608944272,48661191875666868497,2185911559738739594277,104127350297911241532859

%N a(n) = Sum_{k=1..n} gcd(k,n)^(gcd(k,n) - 1).

%H Seiichi Manyama, <a href="/A342436/b342436.txt">Table of n, a(n) for n = 1..387</a>

%F a(n) = Sum_{d|n} phi(n/d) * d^(d-1).

%t a[n_] := Sum[GCD[k, n]^(GCD[k, n] - 1), {k, 1, n}]; Array[a, 20] (* _Amiram Eldar_, Mar 12 2021 *)

%o (PARI) a(n) = sum(k=1, n, gcd(k, n)^(gcd(k, n)-1));

%o (PARI) a(n) = sumdiv(n, d, eulerphi(n/d)*d^(d-1));

%Y Cf. A000010, A056665, A342421, A342423, A342435.

%K nonn

%O 1,2

%A _Seiichi Manyama_, Mar 12 2021