login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
a(n) = A072000(n) - A000720(n). - Michel Marcus, Dec 20 2022
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
Sequence in context: A232506 A133099 A006571 * A100889 A206828 A327164
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Jun 14 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 3 01:57 EDT 2024. Contains 375649 sequences. (Running on oeis4.)