This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A228640 #36 Sep 08 2022 08:46:05 %S A228640 0,1,6,33,280,3145,46956,823585,16781472,387422001,10000100440, %T A228640 285311670721,8916103479504,302875106592409,11112006930972780, %U A228640 437893890382391745,18446744078004651136,827240261886336764449,39346408075494964903956,1978419655660313589124321 %N A228640 a(n) = Sum_{d|n} phi(d)*n^(n/d). %H A228640 Alois P. Heinz, <a href="/A228640/b228640.txt">Table of n, a(n) for n = 0..200</a> %F A228640 a(n) = Sum_{k=1..n} n^gcd(k,n) = n * A056665(n). - _Seiichi Manyama_, Mar 10 2021 %F A228640 a(n) = Sum_{k=1..n} n^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - _Richard L. Ollerton_, May 07 2021 %p A228640 with(numtheory): %p A228640 a:= n-> add(phi(d)*n^(n/d), d=divisors(n)): %p A228640 seq(a(n), n=0..20); %t A228640 a[0] = 0; a[n_] := DivisorSum[n, EulerPhi[#]*n^(n/#)&]; Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Mar 21 2017 *) %o A228640 (Python) %o A228640 from sympy import totient, divisors %o A228640 def A228640(n): %o A228640 return sum(totient(d)*n**(n//d) for d in divisors(n,generator=True)) # _Chai Wah Wu_, Feb 15 2020 %o A228640 (PARI) a(n) = if (n, sumdiv(n, d, eulerphi(d)*n^(n/d)), 0); \\ _Michel Marcus_, Feb 15 2020; corrected Jun 13 2022 %o A228640 (PARI) a(n) = sum(k=1, n, n^gcd(k, n)); \\ _Seiichi Manyama_, Mar 10 2021 %o A228640 (Magma) [0] cat [&+[EulerPhi(d)*n^(n div d): d in Divisors(n)]:n in [1..20]]; // _Marius A. Burtea_, Feb 15 2020 %Y A228640 Main diagonal of A054618, A054619, A185651. %Y A228640 Cf. A000010, A056665. %K A228640 nonn %O A228640 0,3 %A A228640 _Alois P. Heinz_, Aug 28 2013