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.

A334940 Partial sums of A230595.

This page as a plain text file.
%I A334940 #30 Jul 23 2024 15:10:19
%S A334940 0,0,0,1,1,3,3,3,4,6,6,6,6,8,10,10,10,10,10,10,12,14,14,14,15,17,17,
%T A334940 17,17,17,17,17,19,21,23,23,23,25,27,27,27,27,27,27,27,29,29,29,30,30,
%U A334940 32,32,32,32,34,34,36,38,38,38,38,40,40,40,42,42,42,42,44,44,44,44,44,46
%N A334940 Partial sums of A230595.
%C A334940 Sum of the Dirichlet convolution of the characteristic function of primes (A010051) with itself from 1 to n.
%C A334940 (a(n) + A000720(floor(sqrt(n))))/2 equals the number of semiprimes <= n.
%H A334940 Alois P. Heinz, <a href="/A334940/b334940.txt">Table of n, a(n) for n = 1..20000</a>
%F A334940 a(n) = Sum_{k=1..n} Sum_{d|k} A010051(d) * A010051(k/d).
%F A334940 a(n) = 2*Sum_{p prime <= sqrt(n)} A000720(floor(n/p)) - A000720(floor(sqrt(n)))^2.
%F A334940 a(n) = 2*A072000(n) - A000720(floor(sqrt(n))).
%F A334940 a(n) = 2*A072613(n) + A000720(floor(sqrt(n))). - _Vaclav Kotesovec_, May 21 2020
%F A334940 a(n) ~ 2*n*log(log(n))/log(n). - _Vaclav Kotesovec_, May 21 2020
%p A334940 a:= proc(n) option remember; `if`(n<4, 0, a(n-1) +
%p A334940      `if`(numtheory[bigomega](n)=2, `if`(issqr(n), 1, 2), 0))
%p A334940     end:
%p A334940 seq(a(n), n=1..80);  # _Alois P. Heinz_, May 20 2020
%t A334940 f[n_] := DivisorSum[n, 1 &, PrimeQ[#] && PrimeQ[n/#] &]; Accumulate @ Array[f, 100] (* _Amiram Eldar_, May 20 2020 *)
%o A334940 (PARI) a(n) = my(s=sqrtint(n)); 2*sum(k=1, s, if(isprime(k), primepi(n\k), 0)) - primepi(s)^2;
%o A334940 (Python)
%o A334940 from math import isqrt
%o A334940 from sympy import primepi, prime
%o A334940 def A334940(n): return (int(sum(primepi(n//prime(k))-k+1 for k in range(1,primepi(isqrt(n))+1)))<<1) - primepi(isqrt(n)) # _Chai Wah Wu_, Jul 23 2024
%Y A334940 Cf. A000720, A001222, A010051, A072000, A230595.
%K A334940 nonn
%O A334940 1,6
%A A334940 _Daniel Suteu_, May 17 2020