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.

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

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, May 02 2002

Keywords

Comments

mu(k)=-1 if k is the product of an odd number of distinct primes. See A057627 for mu(k)=0.

Crossrefs

Partial sums of A252233.

Programs

  • Maple
    ListTools:-PartialSums([seq(-min(numtheory:-mobius(n),0),n=1..100)]); # Robert Israel, Jan 08 2018
  • Mathematica
    a[n_]:=Sum[Boole[MoebiusMu[k]==-1],{k,n}]; Array[a,78] (* Stefano Spezia, Jan 30 2023 *)
  • PARI
    for(n=1,150,print1(sum(i=1,n,if(moebius(i)+1,0,1)),","))

Formula

From Amiram Eldar, Oct 01 2023: (Start)
a(n) = (A013928(n+1) - A002321(n))/2.
a(n) = A013928(n+1) - A070548(n).
a(n) = A070548(n) - A002321(n).
a(n) ~ (3/Pi^2) * n. (End)

A072613 Number of numbers of the form p*q (p, q distinct primes) less than or equal to n.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Aug 11 2002

Keywords

Comments

There was an old comment here that said a(n) was equal to A070548(n) - 1, but this is false (e.g. at n=210). - N. J. A. Sloane, Sep 10 2008
Number of squarefree semiprimes not exceeding n. - Wesley Ivan Hurt, May 25 2015

Examples

			a(6) = 1 since 2*3 is the only number of the form p*q less than or equal to 6.
		

References

  • G. Tenenbaum, Introduction to Analytic and Probabilistic Number Theory, Cambridge Studies in Advanced Mathematics, 1995.

Crossrefs

Cf. A072000.
Partial sums of A280710.

Programs

  • Maple
    f:=proc(n) local c,i,j,p,q; c:=0; for i from 1 to n do p:=ithprime(i); if p^2 >= n then break; fi; for j from i+1 to n do q:=ithprime(j); if p*q > n then break; fi; c:=c+1; od: od; RETURN(c); end; # N. J. A. Sloane, Sep 10 2008
  • Mathematica
    fPi[n_] := Sum[ PrimePi[n/ Prime@i] - i, {i, PrimePi@ Sqrt@ n}]; Array[ fPi, 81] (* Robert G. Wilson v, Jul 22 2008 *)
    Accumulate[Table[If[PrimeOmega[n] MoebiusMu[n]^2 == 2, 1, 0], {n, 100}]] (* Wesley Ivan Hurt, Jun 01 2017 *)
    Accumulate[Table[If[SquareFreeQ[n]&&PrimeOmega[n]==2,1,0],{n,100}]] (* Harvey P. Dale, Aug 05 2019 *)
  • PARI
    a(n)=sum(k=1,n,if(abs(omega(k)-2)+(1-issquarefree(k)),0,1))
    
  • PARI
    a(n) = my(t=0,i=0); forprime(p = 2, sqrtint(n), i++; t+=primepi(n\p)); t-binomial(i+1,2) \\ David A. Corneth, Jun 02 2017
    
  • PARI
    upto(n) = {my(l=List(), res=[0, 0, 0, 0, 0], j=1, t=0); forprime(p = 2, n, forprime(q=nextprime(p+1), n\p, listput(l, p*q))); listsort(l); for(i=2, #l, t++;res=concat(res, vector(l[i]-l[i-1], j, t))); res} \\ David A. Corneth, Jun 02 2017
    
  • Python
    from math import isqrt
    from sympy import prime, primepi
    def A072613(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(1,primepi(isqrt(n))+1))) - primepi(isqrt(n)) # Chai Wah Wu, Jul 23 2024

Formula

a(n) = Sum_{pA000720, and the sum is over all primes less than sqrt(n). [N-E. Fahssi, Mar 05 2009]
Asymptotically a(n) ~ (n/log(n))log(log(n)) [G. Tenenbaum pp. 200--].
a(n) = Sum_{i<=n | Omega(i)=2} mu(i). - Wesley Ivan Hurt, Jan 05 2013, revised May 25 2015
a(n) = Sum_{i<=n | tau(i)=4} mu(i). - Wesley Ivan Hurt, May 25 2015

A081238 #{(i,j): mu(i)*mu(j) = -1, 1 <= i <= n, 1 <= j <= n}, where mu=A008683 (Moebius function).

Original entry on oeis.org

0, 2, 4, 4, 6, 12, 16, 16, 16, 24, 30, 30, 36, 48, 60, 60, 70, 70, 80, 80, 96, 112, 126, 126, 126, 144, 144, 144, 160, 176, 192, 192, 216, 240, 264, 264, 286, 312, 338, 338, 364, 390, 416, 416, 416, 448, 476, 476, 476, 476, 510, 510, 540, 540, 576, 576, 612, 648
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 11 2003

Keywords

Examples

			n  mu(n)  n: 1 2 3 4 5 6 7 8
-  -----   +----------------->
1   +1     | + - - 0 - + - 0
2   -1     | - + + 0 + - + 0
3   -1     | - + + 0 + - + 0
4    0     | 0 0 0 0 0 0 0 0
5   -1     | - + + 0 + - + 0  a(8)=16, as there are
6   +1     | + - - 0 - + - 0  16 '-1's in the 8 X 8 square
7   -1     | - + + 0 + - + 0  (represented as '-')
8    0     | 0 0 0 0 0 0 0 0
		

Crossrefs

Programs

  • Haskell
    a081238 n = length [() | u <- [1..n], v <- [1..n],
                             a008683 u * a008683 v == -1]
    -- Reinhard Zumkeller, Aug 03 2012
  • Maple
    Nplus:= 0:
    Nminus:=0:
    for n from 1 to 100 do
      v:= numtheory:-mobius(n);
      if v = 1 then Nplus:= Nplus+1
      elif v = -1 then Nminus:= Nminus+1
      fi;
      A[n]:= 2*Nplus*Nminus;
    od:
    seq(A[n],n=1..100); # Robert Israel, Jan 08 2018
  • Mathematica
    Nplus = Nminus = 0;
    For[n = 1, n <= 100, n++, v = MoebiusMu[n];
         If[v == 1, Nplus++,
         If[v == -1, Nminus++]];
         a[n] = 2 Nplus Nminus];
    Array[a, 100] (* Jean-François Alcover, Dec 16 2021, after Robert Israel *)

Formula

a(n) + A081239(n) + A081240(n) = n^2;
a(n) = a(n-1) iff mu(n) = 0.
a(n) = 2*A070548(n)*A070549(n). - Robert Israel, Jan 08 2018

A081240 a(n) = #{(i,j): mu(i)*mu(j) = 1, 1<=i,j<=n}, where mu = A008683 (Moebius function).

Original entry on oeis.org

1, 2, 5, 5, 10, 13, 20, 20, 20, 25, 34, 34, 45, 52, 61, 61, 74, 74, 89, 89, 100, 113, 130, 130, 130, 145, 145, 145, 164, 185, 208, 208, 225, 244, 265, 265, 290, 313, 338, 338, 365, 394, 425, 425, 425, 452, 485, 485, 485, 485, 514, 514, 549, 549, 580, 580, 613
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 11 2003

Keywords

Comments

A081238(n) + A081239(n) + a(n) = n^2;
a(n) = a(n-1) iff mu(n) = 0.

Examples

			n mu(n) ... n: 1 2 3 4 5 6 7 8
- ------ .... |---------------->
1 .. +1 ..... | + - - 0 - + - 0
2 .. -1 ..... | - + + 0 + - + 0
3 .. -1 ..... | - + + 0 + - + 0
4 ... 0 ..... | 0 0 0 0 0 0 0 0
5 .. -1 ..... | - + + 0 + - + 0 a(8)=20, as there are
6 .. +1 ..... | + - - 0 - + - 0 20 '+1's in the 8x8-square
7 .. -1 ..... | - + + 0 + - + 0 (represented as '+')
8 ... 0 ..... | 0 0 0 0 0 0 0 0.
		

Crossrefs

Programs

  • Haskell
    a081240 n = length [() | u <- [1..n], v <- [1..n],
                             a008683 u * a008683 v == 1]
    -- Reinhard Zumkeller, Aug 03 2012
  • Mathematica
    Table[Abs[Sum[Sqrt[MoebiusMu[i]],{i,1,n}]]^2,{n,60}] (* Enrique Pérez Herrero, Jul 30 2012 *)

Formula

a(n) = |Sum_{i=1..n} sqrt(mu(i))|^2. - Enrique Pérez Herrero, Jul 30 2012
a(n) = A070548(n)^2 + A070549(n)^2. - Jason Yuen, Aug 23 2024
Showing 1-4 of 4 results.