login
a(n) = Sum_{k=1..n-1} lcm(k,n-k).
(Formerly M3336)
5

%I M3336 #49 Apr 28 2023 08:16:56

%S 0,0,1,4,8,20,21,56,60,96,105,220,152,364,301,360,464,816,549,1140,

%T 760,1036,1221,2024,1196,2200,2041,2484,2184,4060,2205,4960,3664,4224,

%U 4641,5180,4008,8436,6517,7072,5980,11480,6321,13244,8888,9540,11661,17296

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

%D _Marc LeBrun_, personal communication.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Alois P. Heinz, <a href="/A006580/b006580.txt">Table of n, a(n) for n = 0..10000</a> (first 1000 terms from Reinhard Zumkeller)

%H Marc Le Brun, <a href="/A006577/a006577.pdf">Email to N. J. A. Sloane, Jul 1991</a>.

%F For n > 0, a(n) = (n/6)*Sum_{d|n} (d*phi(d) - A023900(d)). - _Sebastian Karlsson_, Oct 02 2021

%F a(n) = (n/6) * (A057660(n) - A130054(n)), for n > 0. - _Amiram Eldar_, Apr 28 2023

%p a:= n-> add(ilcm(j, n-j), j=0..n):

%p seq(a(n), n=0..70); # _Alois P. Heinz_, Aug 25 2019

%t Table[ Sum[ LCM[ k, n-k ], {k, 1, n-1} ], {n, 2, 50} ] (* _Olivier Gérard_, Aug 15 1997 *)

%t f1[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); f2[p_, e_] := 1 - (p - 1)*e; a[n_] := (Times @@ f1 @@@ (fct = FactorInteger[n]) - Times @@ f2 @@@ fct)*n/6; a[0] = 0; Array[a, 100, 0] (* _Amiram Eldar_, Apr 28 2023 *)

%o (Haskell)

%o a006580 n = a006580_list !! (n-1)

%o a006580_list = map sum a003990_tabl

%o -- _Reinhard Zumkeller_, Aug 05 2012

%o (PARI) a(n) = sum(k=1, n-1, lcm(k, n-k)); \\ _Michel Marcus_, Aug 11 2017

%Y Antidiagonal sums of array A003990.

%Y Cf. A209295.

%Y Cf. A000010, A023900, A057660, A130054.

%K nonn

%O 0,4

%A _N. J. A. Sloane_

%E More terms from _Olivier Gérard_, Aug 15 1997