|
|
A243906
|
|
(Number of semiprimes <= n) - (number of primes <= n).
|
|
3
|
|
|
0, -1, -2, -1, -2, -1, -2, -2, -1, 0, -1, -1, -2, -1, 0, 0, -1, -1, -2, -2, -1, 0, -1, -1, 0, 1, 1, 1, 0, 0, -1, -1, 0, 1, 2, 2, 1, 2, 3, 3, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 4, 5, 4, 4, 3, 4, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 3, 4, 4, 4, 5, 5, 4, 4, 4, 5, 4, 4, 5, 6, 7, 7, 6, 6, 7, 7, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
We know from the asymptotic formulas (see Landau) that the sequence is almost always positive.
|
|
REFERENCES
|
E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, vol. 1, Teubner, Leipzig, 1909; third edition : Chelsea, New York (1974).
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
g:= proc(n) if isprime(n) then -1 elif numtheory:-bigomega(n) = 2 then 1 else 0 fi end proc:
ListTools:-PartialSums(map(g, [$1..100])); # Robert Israel, Dec 20 2022
|
|
MATHEMATICA
|
Accumulate[Table[Which[PrimeQ[n], -1, PrimeOmega[n]==2, 1, True, 0], {n, 1000}]] (* Harvey P. Dale, Jun 15 2014 *)
|
|
PROG
|
(PARI) a(n) = #select(x->(bigomega(x) == 2), [1..n]) - primepi(n); \\ Michel Marcus, Dec 20 2022
(Python)
from math import isqrt
from sympy import prime, primepi
def A243906(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(1, primepi(isqrt(n))+1)))-primepi(n) # Chai Wah Wu, Jul 23 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|