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.

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

Original entry on oeis.org

0, 0, 1, 4, 8, 20, 21, 56, 60, 96, 105, 220, 152, 364, 301, 360, 464, 816, 549, 1140, 760, 1036, 1221, 2024, 1196, 2200, 2041, 2484, 2184, 4060, 2205, 4960, 3664, 4224, 4641, 5180, 4008, 8436, 6517, 7072, 5980, 11480, 6321, 13244, 8888, 9540, 11661, 17296
Offset: 0

Views

Author

Keywords

References

  • Marc LeBrun, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Antidiagonal sums of array A003990.
Cf. A209295.

Programs

  • Haskell
    a006580 n = a006580_list !! (n-1)
    a006580_list = map sum a003990_tabl
    -- Reinhard Zumkeller, Aug 05 2012
    
  • Maple
    a:= n-> add(ilcm(j, n-j), j=0..n):
    seq(a(n), n=0..70);  # Alois P. Heinz, Aug 25 2019
  • Mathematica
    Table[ Sum[ LCM[ k, n-k ], {k, 1, n-1} ], {n, 2, 50} ] (* Olivier Gérard, Aug 15 1997 *)
    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 *)
  • PARI
    a(n) = sum(k=1, n-1, lcm(k, n-k)); \\ Michel Marcus, Aug 11 2017

Formula

For n > 0, a(n) = (n/6)*Sum_{d|n} (d*phi(d) - A023900(d)). - Sebastian Karlsson, Oct 02 2021
a(n) = (n/6) * (A057660(n) - A130054(n)), for n > 0. - Amiram Eldar, Apr 28 2023

Extensions

More terms from Olivier Gérard, Aug 15 1997