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.

Showing 1-4 of 4 results.

A072000 Number of semiprimes (A001358) <= n.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 7, 8, 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, 11, 12, 13, 13, 13, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 18, 19, 19, 20, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 26
Offset: 1

Views

Author

Benoit Cloitre, Jun 19 2002

Keywords

Comments

Number of k <= n such that bigomega(k) = 2.

References

  • A. Hildebrand, On the number of prime factors of an integer, in Ramanujan Revisited (Urbana-Champaign, Ill., 1987), pp. 167-185, Academic Press, Boston, MA, 1988.
  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, vol. 1, Teubner, Leipzig, 1909; third edition : Chelsea, New York (1974).
  • G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.

Crossrefs

Programs

  • Maple
    A072000 := proc(n) local sp,t ; sp := 0 ; for t from 1 to n do if numtheory[bigomega](t) = 2 then sp := sp+1 ; fi ; od ; sp ; end proc: # R. J. Mathar, Jun 10 2007
  • Mathematica
    semiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] -i + 1, {i, PrimePi@Sqrt@n}]; Array[semiPrimePi, 78] (* Robert G. Wilson v, Jan 03 2006 *)
    (* If version >= 7 *) a[n_] := Select[Range[n], PrimeOmega[#] == 2 &] // Length; Table[a[n], {n, 1, 77}] (* Jean-François Alcover, Jun 29 2013 *)
    Accumulate[Table[If[PrimeOmega[n]==2,1,0],{n,100}]] (* Harvey P. Dale, Jun 14 2014 *)
  • PARI
    for(n=1,100,print1(sum(i=1,n,if(bigomega(i)-2,0,1)),","))
    
  • PARI
    a(n)=my(s=0,i=0); forprime(p=2, sqrt(n), s+=primepi(n\p); i++); s - i * (i-1)/2 \\ Charles R Greathouse IV, Apr 21 2011
    
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A072000(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(1,primepi(isqrt(n))+1))) # Chai Wah Wu, Jul 23 2024

Formula

Let PrimePi(x) denote the number of primes <= x (cf. A000720). Then 2*a(n) = Sum_{ primes p <= n/2 } PrimePi(n/p) + PrimePi(sqrt(n)). [Landau, p. 211]
Let PrimePi(x) denote the number of primes <= x (cf. A000720). Then a(n) = Sum_{i=1..PrimePi(sqrt(n))} (PrimePi(n/prime(i)) - i + 1). - Robert G. Wilson v, Feb 07 2006
a(n) = card { x <= n : bigomega(x) = 2 }.
Asymptotically a(n) ~ n*log(log(n))/log(n). [Landau, p. 211]
Let A be a positive integer. Then card { x <= n : bigomega(x) = A } ~ (n/log(n))*log(log(n))^(A-1)/(A-1)! [Landau, p. 211]
a(n) = A072613(n) + A056811(n). - R. J. Mathar, Jun 10 2007
a(n) = Sum_{i=1..n} A064911(i). - Jonathan Vos Post, Dec 30 2007
a(n)*A064911(n) = A174956(n). - Reinhard Zumkeller, Apr 03 2010

Extensions

Edited by Robert G. Wilson v, Feb 15 2006

A070548 a(n) = Cardinality{ k in range 1 <= k <= n such that Moebius(k) = 1 }.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 11, 11, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 17, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23
Offset: 1

Views

Author

Benoit Cloitre, May 02 2002

Keywords

Comments

Moebius(k)=1 iff k is the product of an even number of distinct primes (cf. A008683). See A057627 for Moebius(k)=0.
There was an old comment here that said a(n) was equal to A072613(n) + 1, but this is false (e.g., at n=210). - N. J. A. Sloane, Sep 10 2008

Crossrefs

Programs

  • Maple
    with(numtheory); M:=10000; c:=0; for n from 1 to M do if mobius(n) = 1 then c:=c+1; fi; lprint(n,c); od; # N. J. A. Sloane, Sep 14 2008
  • Mathematica
    a[n_] := If[MoebiusMu[n] == 1, 1, 0]; Accumulate@ Array[a, 100] (* Amiram Eldar, Oct 01 2023 *)
  • PARI
    for(n=1,150,print1(sum(i=1,n,if(moebius(i)-1,0,1)),","))

Formula

Asymptotics: Let N(i) = number of k in the range [1,n] with mu(k) = i, for i = 0, 1, -1. Then we know N(1) + N(-1) ~ 6n/Pi^2 (see A059956). Also, assuming the Riemann hypothesis, | N(1) - N(-1) | < n^(1/2 + epsilon) (see the Mathworld Mertens Conjecture link). Hence a(n) = N(1) ~ 3n/Pi^2 + smaller order terms. - Stefan Steinerberger, Sep 10 2008
a(n) = (1/2)*Sum_{i=1..n} (mu(i)^2 + mu(i)) = (1/2)*(A013928(n+1) + A002321(n)). - Ridouane Oudra, Oct 19 2019
From Amiram Eldar, Oct 01 2023: (Start)
a(n) = A013928(n+1) - A070549(n).
a(n) = A070549(n) + A002321(n). (End)

A334940 Partial sums of A230595.

Original entry on oeis.org

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, 17, 17, 17, 17, 17, 19, 21, 23, 23, 23, 25, 27, 27, 27, 27, 27, 27, 27, 29, 29, 29, 30, 30, 32, 32, 32, 32, 34, 34, 36, 38, 38, 38, 38, 40, 40, 40, 42, 42, 42, 42, 44, 44, 44, 44, 44, 46
Offset: 1

Views

Author

Daniel Suteu, May 17 2020

Keywords

Comments

Sum of the Dirichlet convolution of the characteristic function of primes (A010051) with itself from 1 to n.
(a(n) + A000720(floor(sqrt(n))))/2 equals the number of semiprimes <= n.

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = Sum_{k=1..n} Sum_{d|k} A010051(d) * A010051(k/d).
a(n) = 2*Sum_{p prime <= sqrt(n)} A000720(floor(n/p)) - A000720(floor(sqrt(n)))^2.
a(n) = 2*A072000(n) - A000720(floor(sqrt(n))).
a(n) = 2*A072613(n) + A000720(floor(sqrt(n))). - Vaclav Kotesovec, May 21 2020
a(n) ~ 2*n*log(log(n))/log(n). - Vaclav Kotesovec, May 21 2020

A303917 Number of ordered pairs of primes (p,q) such that p < q <= n and p*q > n.

Original entry on oeis.org

0, 0, 1, 1, 3, 2, 5, 5, 5, 4, 8, 8, 13, 12, 11, 11, 17, 17, 24, 24, 23, 22, 30, 30, 30, 29, 29, 29, 38, 38, 48, 48, 47, 46, 45, 45, 56, 55, 54, 54, 66, 66, 79, 79, 79, 78, 92, 92, 92, 92, 91, 91, 106, 106, 105, 105, 104, 103, 119, 119, 136, 135, 135, 135, 134, 134, 152, 152, 151, 151, 170, 170
Offset: 1

Views

Author

Andres Cicuttin, May 02 2018

Keywords

Comments

From Robert Israel, May 07 2018: (Start)
If n is prime, a(n) = a(n-1) + A000720(n-1).
If n is in A006881, a(n) = a(n-1) - 1.
Otherwise, a(n) = a(n-1). (End)

Examples

			a(1) = a(2) = 0 because there are no two distinct primes less than or equal to 2.
a(3) = 1 because there is only one ordered pair of distinct primes less than or equal to 3: (2,3), and 2*3 > 3.
a(4) = 1 because there is only one ordered pair of distinct primes less than or equal to 4: (2,3), and 2*3 > 4.
a(5) = 3 because there are three ordered pairs of distinct primes less than or equal to 5: (2,3), (2,5) and (3,5), and 2*3 > 5, 2*5 > 5 and 3*5 > 5.
		

Crossrefs

Programs

  • Maple
    a[1]:= 0: d:= 0:
    for n from 2 to 100 do
      if isprime(n) then a[n]:= a[n-1]+d; d:= d+1
      elif numtheory:-bigomega(n)=2 and not issqr(n) then a[n]:= a[n-1]-1
      else a[n]:= a[n-1] fi;
    od:
    seq(a[i],i=1..100); # Robert Israel, May 07 2018
  • Mathematica
    a[n_] := Count[Subsets[Prime@Range@PrimePi@n, {2}], _?(Times @@ # > n &)];
    Table[a[n], {n, 100}];
  • PARI
    a(n) = {my(nb = 0); forprime(q=1, n, forprime(p=1, q-1, if (p*q >n, nb++););); return (nb);} \\ Michel Marcus, May 05 2018

Formula

n^2/2 <= a(n) <= A000720(n/2)*(A000720(n)-A000720(n/2)) ~ n^2/(4*log(n))^2 as n -> infinity. - Robert Israel, May 07 2018
Showing 1-4 of 4 results.