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.

A024924 a(n) = Sum_{k=1..n} prime(k)*floor(n/prime(k)).

Original entry on oeis.org

0, 0, 2, 5, 7, 12, 17, 24, 26, 29, 36, 47, 52, 65, 74, 82, 84, 101, 106, 125, 132, 142, 155, 178, 183, 188, 203, 206, 215, 244, 254, 285, 287, 301, 320, 332, 337, 374, 395, 411, 418, 459, 471, 514, 527, 535, 560, 607, 612, 619, 626, 646, 661, 714, 719, 735, 744, 766, 797, 856
Offset: 0

Views

Author

Keywords

Comments

For n > 2, sum of all distinct prime factors composing numbers from 2 to n.

References

  • M. Kalecki, On certain sums extended over primes or prime factors (in Polish), Prace Mat., Vol. 8 (1963/64), pp. 121-129.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter IV, p. 144.

Crossrefs

Partial sums of A008472.

Programs

  • Magma
    [0] cat [ &+[ NthPrime(k)*Floor(n/NthPrime(k)): k in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Jul 28 2019
    
  • Mathematica
    Join[{0}, Table[Sum[Prime[k] Floor[n / Prime[k]], {k, 1, n}], {n, 1, 60}]] (* Vincenzo Librandi, Jul 28 2019 *)
    Join[{0}, Accumulate[Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}]]] (* Vaclav Kotesovec, May 20 2020 *)
  • PARI
    a(n) = sum(k=1, n, prime(k)*(n\prime(k))); \\ Michel Marcus, Mar 01 2015
    
  • PARI
    a(n)=my(s); forprime(p=2,n, s+=n\p*p); s \\ Charles R Greathouse IV, Jun 26 2020
    
  • Python
    from sympy import prime
    def A024924(n): return sum((p:=prime(k))*(n//p) for k in range(1,n+1)) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = n*A000720(n) - A024934(n). - Max Alekseyev, Feb 10 2012
a(n) = A034387([n/1]) + A034387([n/2]) + ... + A034387([n/n]). Terms can be computed efficiently with the following formula: a(n) = A034387([n/1]) + ... + A034387([n/m]) - m*A034387([n/m]) + Sum_{prime p<=n/m} p*[n/p], where m = [sqrt(n)]. - Max Alekseyev, Feb 10 2012
G.f.: Sum_{k >=1} (prime(k)*x^prime(k)/(1-x^prime(k)))/(1-x). - Vladeta Jovovic, Aug 11 2004
a(n) ~ ((Pi^2 + o(1))/12) * n^2/log(n) (Kalecki, 1963/64). - Amiram Eldar, Mar 04 2021

Extensions

a(0)=0 prepended by Max Alekseyev, Feb 10 2012