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.

A013940 a(n) = Sum_{k=1..n} floor(n/prime(k)^2).

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 9, 9, 10, 11, 11, 11, 11, 12, 12, 12, 12, 14, 14, 14, 14, 15, 15, 15, 15, 16, 17, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 23, 24, 24, 24, 25, 26, 26, 26, 26, 27, 27, 27, 27, 29
Offset: 1

Views

Author

Keywords

Comments

Partial sums of A056170. - Michel Marcus, Aug 24 2013

Crossrefs

Cf. A085548.

Programs

  • Magma
    [(&+[Floor(n/NthPrime(k)^2): k in [1..n]]): n in [1..70]]; // G. C. Greubel, Nov 25 2018
    
  • Maple
    A056170:= n -> nops(select(t -> (t[2]>1), ifactors(n)[2]));
    N:= 10000; # to get terms up to a(N)
    A:= map(round,Statistics:-CumulativeSum(Array(1..N, A056170)));
    seq(A[n],n=1..N); # Robert Israel, Jun 03 2014
  • Mathematica
    Table[Sum[Floor[n/Prime[k]^2],{k,n}],{n,70}] (* Harvey P. Dale, Mar 30 2018 *)
  • PARI
    a(n) = sum(k = 1, n, n\prime(k)^2); \\ Michel Marcus, Aug 24 2013
    
  • PARI
    a(n) = my(s=0); forprime(p=2, sqrtint(n), s += n\(p*p)); s; \\ Daniel Suteu, Nov 24 2018
    
  • Sage
    [sum(floor(n/nth_prime(k)^2) for k in (1..n)) for n in (1..70)] # G. C. Greubel, Nov 25 2018

Formula

G.f.: (1/(1 - x))*Sum_{k>=1} x^(prime(k)^2)/(1 - x^(prime(k)^2)). - Ilya Gutkovskiy, Feb 11 2017
a(n) ~ A085548 * n. - Daniel Suteu, Nov 24 2018