cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A332517 #36 Sep 08 2022 08:46:25
%S A332517 1,5,29,274,3129,47515,823549,16843268,387459861,10009769725,
%T A332517 285311670621,8918311856102,302875106592265,11112685048729175,
%U A332517 437893951473411261,18447025557276459016,827240261886336764193,39346558373052524325225,1978419655660313589123997
%N A332517 a(n) = Sum_{k=1..n} gcd(n,k)^n.
%C A332517 If n is prime, a(n) = n-1 + n^n. - _Robert Israel_, Feb 16 2020
%H A332517 Robert Israel, <a href="/A332517/b332517.txt">Table of n, a(n) for n = 1..386</a>
%F A332517 a(n) = Sum_{d|n} phi(n/d) * d^n.
%F A332517 a(n) = Sum_{d|n} mu(n/d) * d * sigma_(n-1)(d).
%F A332517 a(n) ~ n^n.
%F A332517 From _Richard L. Ollerton_, May 09 2021: (Start)
%F A332517 a(n) = Sum_{k=1..n} (n/gcd(n,k))^n*phi(gcd(n,k))/phi(n/gcd(n,k)).
%F A332517 a(n) = Sum_{k=1..n} mu(n/gcd(n,k))*gcd(n,k)*sigma_(n-1)(gcd(n,k))/phi(n/gcd(n,k)). (End)
%p A332517 f:= n -> add(igcd(n,k)^n,k=1..n):
%p A332517 map(f, [$1..30]); # _Robert Israel_, Feb 16 2020
%t A332517 Table[Sum[GCD[n, k]^n, {k, 1, n}], {n, 1, 19}]
%t A332517 Table[Sum[EulerPhi[n/d] d^n, {d, Divisors[n]}], {n, 1, 19}]
%t A332517 Table[Sum[MoebiusMu[n/d] d DivisorSigma[n - 1, d], {d, Divisors[n]}], {n, 1, 19}]
%o A332517 (PARI) a(n) = sum(k=1, n, gcd(n, k)^n); \\ _Michel Marcus_, Feb 14 2020
%o A332517 (Magma) [&+[Gcd(n,k)^n:k in [1..n]]: n in [1..20]]; // _Marius A. Burtea_, Feb 15 2020
%o A332517 (Python)
%o A332517 from sympy import totient, divisors
%o A332517 def A332517(n):
%o A332517     return sum(totient(d)*(n//d)**n for d in divisors(n,generator=True)) # _Chai Wah Wu_, Feb 15 2020
%Y A332517 Cf. A000010, A008683, A018804, A031971, A069097, A226561, A228640, A321294.
%K A332517 nonn
%O A332517 1,2
%A A332517 _Ilya Gutkovskiy_, Feb 14 2020