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)).

This page as a plain text file.
%I A024924 #54 Jan 30 2025 11:22:29
%S A024924 0,0,2,5,7,12,17,24,26,29,36,47,52,65,74,82,84,101,106,125,132,142,
%T A024924 155,178,183,188,203,206,215,244,254,285,287,301,320,332,337,374,395,
%U A024924 411,418,459,471,514,527,535,560,607,612,619,626,646,661,714,719,735,744,766,797,856
%N A024924 a(n) = Sum_{k=1..n} prime(k)*floor(n/prime(k)).
%C A024924 For n > 2, sum of all distinct prime factors composing numbers from 2 to n.
%D A024924 M. Kalecki, On certain sums extended over primes or prime factors (in Polish), Prace Mat., Vol. 8 (1963/64), pp. 121-129.
%D A024924 József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter IV, p. 144.
%H A024924 Vaclav Kotesovec, <a href="/A024924/b024924.txt">Table of n, a(n) for n = 0..10000</a>
%H A024924 Vaclav Kotesovec, <a href="/A024924/a024924.jpg">Plot of a(n) / ((Pi^2/12) * n^2/log(n)) for n = 1..10^8</a>
%F A024924 a(n) = n*A000720(n) - A024934(n). - _Max Alekseyev_, Feb 10 2012
%F A024924 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
%F A024924 G.f.: Sum_{k >=1} (prime(k)*x^prime(k)/(1-x^prime(k)))/(1-x). - _Vladeta Jovovic_, Aug 11 2004
%F A024924 a(n) ~ ((Pi^2 + o(1))/12) * n^2/log(n) (Kalecki, 1963/64). - _Amiram Eldar_, Mar 04 2021
%t A024924 Join[{0}, Table[Sum[Prime[k] Floor[n / Prime[k]], {k, 1, n}], {n, 1, 60}]] (* _Vincenzo Librandi_, Jul 28 2019 *)
%t A024924 Join[{0}, Accumulate[Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}]]] (* _Vaclav Kotesovec_, May 20 2020 *)
%o A024924 (PARI) a(n) = sum(k=1, n, prime(k)*(n\prime(k))); \\ _Michel Marcus_, Mar 01 2015
%o A024924 (PARI) a(n)=my(s); forprime(p=2,n, s+=n\p*p); s \\ _Charles R Greathouse IV_, Jun 26 2020
%o A024924 (Magma) [0] cat [ &+[ NthPrime(k)*Floor(n/NthPrime(k)): k in [1..n]]: n in [1..60]]; // _Vincenzo Librandi_, Jul 28 2019
%o A024924 (Python)
%o A024924 from sympy import prime
%o A024924 def A024924(n): return sum((p:=prime(k))*(n//p) for k in range(1,n+1)) # _Chai Wah Wu_, Sep 18 2023
%Y A024924 Partial sums of A008472.
%Y A024924 Cf. A000720, A024934, A034387.
%K A024924 nonn
%O A024924 0,3
%A A024924 _Clark Kimberling_
%E A024924 a(0)=0 prepended by _Max Alekseyev_, Feb 10 2012