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.

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

Original entry on oeis.org

1, 4, 12, 24, 55, 66, 154, 176, 279, 320, 616, 468, 1027, 910, 1110, 1376, 2329, 1656, 3268, 2320, 3171, 3674, 5842, 3624, 6525, 6136, 7398, 6636, 11803, 6630, 14446, 10944, 12837, 13940, 15820, 12096, 24679, 19570, 21450, 18080, 33661, 18984, 38872, 26884
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000010, A018804, A051173 (triangle whose n-th row sum is a(n)), A057660, A057661.

Programs

  • Haskell
    a051193 = sum . a051173_row  -- Reinhard Zumkeller, Feb 11 2014
    
  • Maple
    a:=n->add(ilcm( n, j ), j=1..n): seq(a(n), n=1..50); # Zerinvary Lajos, Nov 07 2006
  • Mathematica
    Table[Sum[LCM[k, n], {k, 1, n}], {n, 1, 39}] (* Geoffrey Critzer, Feb 16 2015 *)
    f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := n * (1 + Times @@ f @@@ FactorInteger[n])/2; Array[a, 100] (* Amiram Eldar, Apr 26 2023 *)
  • PARI
    a(n) = sum(k=1, n, lcm(n,k)); \\ Michel Marcus, Feb 06 2015
    
  • Python
    from math import prod
    from sympy import factorint
    def A051193(n): return n*(1+prod((p**((e<<1)+1)+1)//(p+1) for p,e in factorint(n).items())>>1) # Chai Wah Wu, Aug 05 2024

Formula

a(n) = n*(1+Sum_{d|n} d*phi(d))/2 = n*(1+A057660(n))/2 = n*A057661(n). - Vladeta Jovovic, Jun 21 2002
G.f.: x*f'(x), where f(x) = x/(2*(1 - x)) + (1/2)*Sum_{k>=1} k*phi(k)*x^k/(1 - x^k) and phi() is the Euler totient function (A000010). - Ilya Gutkovskiy, Aug 31 2017
Sum_{k=1..n} a(k) ~ 3 * zeta(3) * n^4 / (4*Pi^2). - Vaclav Kotesovec, May 29 2021