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

This page as a plain text file.
%I A013940 #34 Sep 08 2022 08:44:38
%S A013940 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,
%T A013940 12,12,12,12,14,14,14,14,15,15,15,15,16,17,17,17,18,19,20,20,21,21,22,
%U A013940 22,23,23,23,23,24,24,24,25,26,26,26,26,27,27,27,27,29
%N A013940 a(n) = Sum_{k=1..n} floor(n/prime(k)^2).
%C A013940 Partial sums of A056170. - _Michel Marcus_, Aug 24 2013
%H A013940 Robert Israel, <a href="/A013940/b013940.txt">Table of n, a(n) for n = 1..10000</a>
%F A013940 G.f.: (1/(1 - x))*Sum_{k>=1} x^(prime(k)^2)/(1 - x^(prime(k)^2)). - _Ilya Gutkovskiy_, Feb 11 2017
%F A013940 a(n) ~ A085548 * n. - _Daniel Suteu_, Nov 24 2018
%p A013940 A056170:= n -> nops(select(t -> (t[2]>1), ifactors(n)[2]));
%p A013940 N:= 10000; # to get terms up to a(N)
%p A013940 A:= map(round,Statistics:-CumulativeSum(Array(1..N, A056170)));
%p A013940 seq(A[n],n=1..N); # _Robert Israel_, Jun 03 2014
%t A013940 Table[Sum[Floor[n/Prime[k]^2],{k,n}],{n,70}] (* _Harvey P. Dale_, Mar 30 2018 *)
%o A013940 (PARI) a(n) = sum(k = 1, n, n\prime(k)^2); \\ _Michel Marcus_, Aug 24 2013
%o A013940 (PARI) a(n) = my(s=0); forprime(p=2, sqrtint(n), s += n\(p*p)); s; \\ _Daniel Suteu_, Nov 24 2018
%o A013940 (Magma) [(&+[Floor(n/NthPrime(k)^2): k in [1..n]]): n in [1..70]]; // _G. C. Greubel_, Nov 25 2018
%o A013940 (Sage) [sum(floor(n/nth_prime(k)^2) for k in (1..n)) for n in (1..70)] # _G. C. Greubel_, Nov 25 2018
%Y A013940 Cf. A085548.
%K A013940 nonn
%O A013940 1,8
%A A013940 _N. J. A. Sloane_, _Henri Lifchitz_, Dec 11 1996