OFFSET
1,6
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
FORMULA
a(n) ~ 2*n*log(log(n))/log(n). - Vaclav Kotesovec, May 21 2020
MAPLE
a:= proc(n) option remember; `if`(n<4, 0, a(n-1) +
`if`(numtheory[bigomega](n)=2, `if`(issqr(n), 1, 2), 0))
end:
seq(a(n), n=1..80); # Alois P. Heinz, May 20 2020
MATHEMATICA
f[n_] := DivisorSum[n, 1 &, PrimeQ[#] && PrimeQ[n/#] &]; Accumulate @ Array[f, 100] (* Amiram Eldar, May 20 2020 *)
PROG
(PARI) a(n) = my(s=sqrtint(n)); 2*sum(k=1, s, if(isprime(k), primepi(n\k), 0)) - primepi(s)^2;
(Python)
from math import isqrt
from sympy import primepi, prime
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Suteu, May 17 2020
STATUS
approved