%I #42 Dec 03 2023 05:03:06
%S 1,1,17,82,354,626,2275,3108,7395,9044,25333,17668,60710,50470,88388,
%T 103496,243848,129750,432345,266088,497574,497178,1151403,539912,
%U 1541770,1153724,1900089,1516844,3756718,1246568,5273999
%N a(n) = Sum_{k=1..n, gcd(n,k) = 1} k^4.
%C If gcd(n,30) = 1, then a(n) is divisible by n. If n has at least one prime factor == 1 (mod 30), then a(n) is divisible by n. - _Jianing Song_, Jul 13 2018
%D Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 15, the function phi_4(n).
%D L. E. Dickson, History of the Theory of Numbers, Vol. I (Reprint 1966), p. 140.
%H Seiichi Manyama, <a href="/A053820/b053820.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Vincenzo Librandi)
%H John D. Baum, <a href="https://www.jstor.org/stable/2690056">A Number-Theoretic Sum</a>, Mathematics Magazine 55.2 (1982): 111-113.
%H P. G. Brown, <a href="http://www.jstor.org/stable/3621931">Some comments on inverse arithmetic functions</a>, Math. Gaz. 89 (2005) 403-408.
%F a(n) = (6*n^4*A000010(n)+10*n^3*A023900(n)-n*A063453(n))/30 for n>1. Formula is derived from a more general formula of A. Thacker (1850), see [Dickson, Brown]. - _Franz Vrabec_, Aug 21 2005
%F G.f. A(x) satisfies: A(x) = x*(1 + 11*x + 11*x^2 + x^3)/(1 - x)^6 - Sum_{k>=2} k^4 * A(x^k). - _Ilya Gutkovskiy_, Mar 29 2020
%F Sum_{k=1..n} a(k) ~ n^6 / (5*Pi^2). - _Amiram Eldar_, Dec 03 2023
%t a[n_] := Sum[If[GCD[n, k] == 1, k^4, 0], {k, 1, n}]; Table[a[n], {n, 1, 31}] (* _Jean-François Alcover_, Feb 26 2014 *)
%t a[1] = 1; a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; (n^4/5) * Times @@ ((p - 1)*p^(e - 1)) + (n^3/3) * Times @@ (1 - p) - (n/30) * Times @@ (1 - p^3)]; Array[a, 100] (* _Amiram Eldar_, Dec 03 2023 *)
%o (PARI) a(n) = sum(k=1, n, (gcd(n,k) == 1)*k^4); \\ _Michel Marcus_, Feb 26 2014
%o (PARI) a(n) = {my(f = factor(n)); if(n == 1, 1, (n^4/5) * eulerphi(f) + (n^3/3) * prod(i = 1, #f~, 1 - f[i, 1]) - (n/30) * prod(i = 1, #f~, 1 - f[i, 1]^3));} \\ _Amiram Eldar_, Dec 03 2023
%Y Column k=4 of A308477.
%Y Cf. A000010, A023900, A053818, A053819, A063453.
%K nonn
%O 1,3
%A _N. J. A. Sloane_, Apr 07 2000