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.

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)

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

A346488 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), for all i, j >= 1, where f(n) = 0 if mu(n) = -1, and f(n) = n for all other numbers (with mu = Möbius mu, A008683).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 17, 18, 19, 20, 2, 2, 2, 21, 22, 23, 24, 25, 2, 26, 27, 28, 2, 2, 2, 29, 30, 31, 2, 32, 33, 34, 35, 36, 2, 37, 38, 39, 40, 41, 2, 42, 2, 43, 44, 45, 46, 2, 2, 47, 48, 2, 2, 49, 2, 50, 51, 52, 53, 2, 2, 54, 55, 56, 2, 57, 58, 59, 60, 61, 2, 62, 63, 64, 65, 66, 67, 68, 2, 69, 70, 71
Offset: 1

Views

Author

Antti Karttunen, Aug 20 2021

Keywords

Comments

Restricted growth sequence transform of the sequence f(n) = 0 if mu(n) = -1, and f(n) = n for mu(n) >= 0.
For all i, j:
A305800(i) = A305800(j) => a(i) = a(j) => A305980(i) = A305980(j),
a(i) = a(j) => b(i) = b(j), where b is the pointwise sum of any two multiplicative sequences c and d that are Dirichlet inverses of each other. For example, b can be a sequence like A319340, A323885, or A347094.

Crossrefs

Cf. A008683, A070549, A030059 (positions of 2's).

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    Aux346488(n) = if(moebius(n)<0,0,n);
    v346488 = rgs_transform(vector(up_to, n, Aux346488(n)));
    A346488(n) = v346488[n];
    
  • PARI
    A070549(n) = sum(k=1,n,(-1==moebius(k)));
    A346488(n) = if(1==n,1,if(-1==moebius(n),2,1+n-A070549(n)));

Formula

a(1) = 1, and for n > 1, if A008683(n) = -1, a(n) = 2, otherwise a(n) = 1 + n - A070549(n).
Showing 1-4 of 4 results.