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-10 of 10 results.

A224987 Numbers such that Liouville's function (A002819) and the little omega analog to Liouville's function (A174863) are equal.

Original entry on oeis.org

1, 2, 3, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 13092, 13093, 13094, 13095, 13096, 13097, 13098, 13099, 13100, 13101, 13102, 13103, 13104, 13105, 13106, 13107, 13232, 13233, 13234, 13235, 13239, 13240, 13241, 13242
Offset: 1

Views

Author

Donovan Johnson, Apr 22 2013

Keywords

Comments

Numbers n such that A002819(n) = A174863(n). There are 9056 terms <= 10^12 (the largest is 16959554). For n from 16959555 to 10^12, A002819(n) < A174863(n).

Examples

			n = 43:
A002819(n) = sum_{k = 1..n} (-1)^bigomega(k) = -3.
A174863(n) = sum_{k = 1..n} (-1)^omega(k) = -3.
A002819(43) = A174863(43) = -3.
		

Crossrefs

Programs

  • Mathematica
    PrimeOmega[n_] := Plus @@ FactorInteger[n][[All, 2]]; PrimeNu[n_] := Length[FactorInteger[n]]; Reap[For[s1 = 0; s2 = 0; n = 1, n < 15000, n++, s1 = s1 + (-1)^PrimeOmega[n]; s2 = s2 + (-1)^PrimeNu[n]; If[s1 == s2, Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, May 03 2013, after Pari *)
  • PARI
    s1=0; s2=0; c=0; for(n=1, 16959554, s1=s1+(-1)^bigomega(n); s2=s2+(-1)^omega(n); if(s1==s2, c++; write("b224987.txt", c " " n)))

A076479 a(n) = mu(rad(n)), where mu is the Moebius-function (A008683) and rad is the radical or squarefree kernel (A007947).

Original entry on oeis.org

1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 14 2002

Keywords

Comments

Multiplicative: a(1) = 1, a(n) for n >=2 is sign of parity of number of distinct primes dividing n. a(p) = -1, a(pq) = 1, a(pq...z) = (-1)^k, a(p^k) = -1, where p,q,.. z are distinct primes and k natural numbers. - Jaroslav Krizek, Mar 17 2009
a(n) is the unitary Moebius function, i.e., the inverse of the constant 1 function under the unitary convolution defined by (f X g)(n)= sum of f(d)g(n/d), where the sum is over the unitary divisors d of n (divisors d of n such that gcd(d,n/d)=1). - Laszlo Toth, Oct 08 2009

Crossrefs

Programs

  • Haskell
    a076479 = a008683 . a007947  -- Reinhard Zumkeller, Jun 01 2013
    
  • Magma
    [(-1)^(#PrimeDivisors(n)): n in [1..100]]; // Vincenzo Librandi, Dec 31 2018
    
  • Maple
    A076479 := proc(n)
        (-1)^A001221(n) ;
    end proc:
    seq(A076479(n),n=1..80) ; # R. J. Mathar, Nov 02 2016
  • Mathematica
    Table[(-1)^PrimeNu[n], {n,50}] (* Enrique Pérez Herrero, Jan 17 2013 *)
  • PARI
    N=66;
    mu=vector(N); mu[1]=1;
    { for (n=2,N,
        s = 0;
        fordiv (n,d,
            if (gcd(d,n/d)!=1, next() ); /* unitary divisors only */
            s += mu[d];
        );
        mu[n] = -s;
    ); };
    mu /* Joerg Arndt, May 13 2011 */
    /* omitting the line if ( gcd(...)) gives the usual Moebius function */
    
  • PARI
    a(n)=(-1)^omega(n) \\ Charles R Greathouse IV, Aug 02 2013
    
  • Python
    from math import prod
    from sympy.ntheory import mobius, primefactors
    def A076479(n): return mobius(prod(primefactors(n))) # Chai Wah Wu, Sep 24 2021

Formula

a(n) = A008683(A007947(n)).
a(n) = (-1)^A001221(n). Multiplicative with a(p^e) = -1. - Vladeta Jovovic, Dec 03 2002
a(n) = sign(A180403(n)). - Mats Granvik, Oct 08 2010
Sum_{n>=1} a(n)*phi(n)/n^3 = A065463 with phi()=A000010() [Cohen, Lemma 3.5]. - R. J. Mathar, Apr 11 2011
Dirichlet convolution of A000012 with A226177 (signed variant of A074823 with one factor mu(n) removed). - R. J. Mathar, Apr 19 2011
Sum_{n>=1} a(n)/n^2 = A065469. - R. J. Mathar, Apr 19 2011
a(n) = Sum_{d|n} mu(d)*tau_2(d) = Sum_{d|n} A008683(d)*A000005(d) . - Enrique Pérez Herrero, Jan 17 2013
a(A030230(n)) = -1; a(A030231(n)) = +1. - Reinhard Zumkeller, Jun 01 2013
Dirichlet g.f.: zeta(s) * Product_{p prime} (1 - 2p^(-s)). - Álvar Ibeas, Dec 30 2018
Sum_{n>=1} a(n)/n = 0 (van de Lune and Dressler, 1975). - Amiram Eldar, Mar 05 2021
From Richard L. Ollerton, May 07 2021: (Start)
For n>1, Sum_{k=1..n} a(gcd(n,k))*phi(gcd(n,k))*rad(gcd(n,k))/gcd(n,k) = 0.
For n>1, Sum_{k=1..n} a(n/gcd(n,k))*phi(gcd(n,k))*rad(n/gcd(n,k))*gcd(n,k) = 0. (End)
a(n) = Sum_{d1|n} Sum_{d2|n} mu(d1*d2). - Ridouane Oudra, May 25 2023

A346617 Irregular triangle T(n,m) read by rows (n >= 1, 1 <= m <= Max(A001221([1..n]))): T(n,m) = number of integers in [1,n] with m distinct prime factors.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 19 2021

Keywords

Comments

Column k >= 1 of the triangle gives the number of numbers i in the range 1 <= i <= n with omega(i) = A001221(i) = k.
A285577 is a similar triangle which has an extra column on the left for k = 0.

Examples

			Rows 1 through 12 are:
1 [0]
2 [1]
3 [2]
4 [3]
5 [4]
6 [4, 1]
7 [5, 1]
8 [6, 1]
9 [7, 1]
10 [7, 2]
11 [8, 2]
12 [8, 3]
13 [9, 3]
		

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, pp. 52-56.
  • Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Chelsea Publishing, NY 1953, Vol. 1, p. 211, Eq. (5).

Crossrefs

Row lengths give A111972 (for n>1).

Programs

  • Maple
    omega := proc(n) nops(numtheory[factorset](n)) end proc: # # A001221
    A:=Array(1..20,0);
    ans:=[[0]];
    mx:=0;
    for n from 2 to 100 do
    k:=omega(n);
    if k>mx then mx:=k; fi;
    A[k]:=A[k]+1;
    ans:=[op(ans),[seq(A[i],i=1..mx)]];
    od:
    ans;
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, 0,
          b(n-1)+x^nops(ifactors(n)[2]))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..max(1, degree(p))))(b(n)):
    seq(T(n), n=1..40);  # Alois P. Heinz, Aug 19 2021
  • Mathematica
    T[n_] := If[n == 1, {0},
         Range[n] // PrimeNu // Tally // Rest // #[[All, 2]]&];
    Array[T, 40] // Flatten (* Jean-François Alcover, Mar 08 2022 *)

Formula

For fixed k, T(n,k) ~ (1/(k-1)!) * n * (log log n)^(k-1) / log n [Landau].
From Alois P. Heinz, Aug 19 2021: (Start)
Sum_{k>=1} k * T(n,k) = A013939(n).
Sum_{k>=1} k^2 * T(n,k) = A069811(n).
Sum_{k>=1} (-1)^(k-1) * T(n,k) = A123066(n).
Sum_{k>=1} (-1)^k * T(n,k) = -1 + A174863(n).
Sum_{k>=1} T(n,k) = n - 1. (End)

A275547 Numbers n that have an equal number of even and odd values of A001221(k) for 1 <= k <= n.

Original entry on oeis.org

2, 40, 46, 48, 50, 7960, 7962, 7984, 7986, 8808, 8810, 8812, 8816, 8822, 8824, 8826, 8828, 8830, 8836, 8844, 8846, 8848, 8850, 8854, 8856, 8858, 8860, 8862, 8864, 8866, 8872, 8878, 8970, 8972, 8974, 9064, 9078, 9080, 9082, 9084, 9086, 9088, 9096, 9164, 9220
Offset: 1

Views

Author

G. L. Honaker, Jr., Aug 01 2016

Keywords

Comments

Is this sequence infinite?

Examples

			a(2) = 40 because if we check omega(n) = A001221(n) for each n = 1..40, then half will be even numbers and half will be odd numbers.
		

Crossrefs

Programs

  • Maple
    omega:= n-> nops(numtheory[factorset](n)):
    b:= proc(n) option remember; (-1)^omega(n)+`if`(n>1, b(n-1), 0) end:
    a:= proc(n) option remember; local k; for k from 1+
         `if`(n=1, 0, a(n-1)) while b(k)<>0 do od; k
        end:
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 02 2016
  • Mathematica
    a[1] = 2; a[n_] := a[n] = Block[{k = a[n-1], s=0}, While[(s += (-1)^ PrimeNu[++k]) != 0]; k]; Array[a, 100] (* Giovanni Resta, Aug 03 2016 *)
  • PARI
    is(n) = my(i=0, j=0); for(k=1, n, if(omega(k)%2==0, i++, j++)); if(i==j, return(1), return(0)) \\ Felix Fröhlich, Aug 02 2016
    
  • PARI
    isok(n) = {my(v = vector(n, k, omega(k))); #select(x->x % 2 == 1, v) == n/2;} \\ Michel Marcus, Aug 02 2016

Formula

A174863(a(n)) = 0. - Alois P. Heinz, Aug 02 2016

Extensions

More terms from Alois P. Heinz, Aug 02 2016

A346457 a(n) is the smallest number k such that |Sum_{j=1..k} (-1)^omega(j)| = n, where omega(j) is the number of distinct primes dividing j.

Original entry on oeis.org

1, 4, 5, 8, 9, 32, 77, 88, 93, 94, 95, 96, 99, 100, 119, 124, 147, 148, 161, 162, 189, 206, 207, 208, 209, 210, 213, 214, 215, 216, 217, 218, 219, 226, 329, 330, 333, 334, 335, 394, 395, 416, 417, 424, 425, 428, 489, 514, 515, 544, 545, 546, 549, 554, 579, 584, 723, 724, 725, 800
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 19 2021

Keywords

Crossrefs

Programs

  • Maple
    N:= 10000: # for values <= N
    omega:= n -> nops(numtheory:-factorset(n)):
    R:= map(n -> (-1)^omega(n),[$1..10000]):
    S:= map(abs,ListTools:-PartialSums(R)):
    m:= max(S):
    V:= Vector(m):
    for i from 1 to N do if S[i] > 0 and V[S[i]] = 0 then V[S[i]]:= i fi od:
    convert(V,list); # Robert Israel, Oct 30 2023
  • Mathematica
    Table[k=1;While[Abs[Sum[(-1)^PrimeNu@j,{j,k}]]!=n,k++];k,{n,30}] (* Giorgos Kalogeropoulos, Jul 19 2021 *)
  • PARI
    a(n) = my(k=1); while (abs(sum(j=1, k, (-1)^omega(j))) != n, k++); k; \\ Michel Marcus, Jul 19 2021

Formula

a(n) = min {k : |Sum_{j=1..k} mu(rad(j))| = n}, where mu is the Moebius function and rad is the squarefree kernel.

A327666 a(n) = Sum_{k = 1..n} (-1)^(Omega(k) - omega(k)), where Omega(k) counts prime factors of k with multiplicity and omega(k) counts distinct prime factors.

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 5, 6, 5, 6, 7, 6, 7, 8, 9, 8, 9, 8, 9, 8, 9, 10, 11, 12, 11, 12, 13, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 26, 25, 26, 27, 26, 25, 24, 25, 24, 25, 26, 27, 28, 29, 30, 31, 30, 31, 32, 31, 30, 31, 32, 33, 32, 33, 34
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 21 2019

Keywords

Comments

Partial sums of A162511.

Examples

			Omega(1) = omega(1) = 0. The difference is 0, so (-1)^0 = 1, so a(1) = 1.
Omega(2) = omega(2) = 1. The difference is 0, so (-1)^0 = 1, which is added to a(1) to give a(2) = 2.
Omega(3) = omega(3) = 1. The difference is 0, so (-1)^0 = 1, which is added to a(2) to give a(3) = 3.
Omega(4) = 2 but omega(4) = 1. The difference is 1, so (-1)^1 = -1, which is added to a(3) to give a(4) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(-1)^(PrimeOmega[k] - PrimeNu[k]), {k, n}], {n, 70}]
    f[p_, e_] := (-1)^(e - 1); Accumulate @ Table[Times @@ f @@@ FactorInteger[n], {n, 1, 100}] (* Amiram Eldar, Sep 18 2022 *)
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(k=2, n, v[k] = v[k-1] + (-1)^(bigomega(k)-omega(k))); v} \\ Andrew Howroyd, Sep 23 2019
    
  • Python
    from functools import reduce
    from sympy import factorint
    def A327666(n): return sum(-1 if reduce(lambda a,b:~(a^b), factorint(i).values(),0)&1 else 1 for i in range(1,n+1)) # Chai Wah Wu, Jan 01 2023

Formula

a(1) = 1, a(n) = a(n - 1) + (-1)^(Omega(n) - omega(n)) for n > 1.
a(n) ~ c * n, where c = A307868. - Amiram Eldar, Sep 18 2022

A346455 a(n) is the smallest number k such that Sum_{j=1..k} (-1)^omega(j) = n, where omega(j) is the number of distinct primes dividing j.

Original entry on oeis.org

1, 52, 55, 56, 57, 58, 77, 88, 93, 94, 95, 96, 99, 100, 119, 124, 147, 148, 161, 162, 189, 206, 207, 208, 209, 210, 213, 214, 215, 216, 217, 218, 219, 226, 329, 330, 333, 334, 335, 394, 395, 416, 417, 424, 425, 428, 489, 514, 515, 544, 545, 546, 549, 554, 579, 584, 723, 724, 725, 800
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 19 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=(k=1;While[Sum[(-1)^PrimeNu@j,{j,k}]!=n,k++];k);Array[a,25] (* Giorgos Kalogeropoulos, Jul 19 2021 *)
  • PARI
    a(n) = my(k=1); while (sum(j=1, k, (-1)^omega(j)) !=n, k++); k; \\ Michel Marcus, Jul 19 2021

Formula

a(n) = min {k : Sum_{j=1..k} mu(rad(j)) = n}, where mu is the Moebius function and rad is the squarefree kernel.

A346456 a(n) is the smallest number k such that Sum_{j=1..k} (-1)^omega(j) = -n, where omega(j) is the number of distinct primes dividing j.

Original entry on oeis.org

3, 4, 5, 8, 9, 32, 9283, 9284, 9285, 9292, 9293, 9294, 9295, 9296, 9343, 9434, 9437, 9440, 9479, 9686, 9689, 9690, 9697, 9698, 9699, 9700, 9711, 9716, 9717, 9718, 9719, 9720, 9721, 9740, 9741, 9852, 9855, 9856, 9857, 10284, 10285, 10286, 10305, 10314, 10325, 10326, 10331, 10338
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 19 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=(k=1;While[Sum[(-1)^PrimeNu@j,{j,k}]!=-n,k++];k);Array[a,6] (* Giorgos Kalogeropoulos, Jul 19 2021 *)
  • PARI
    a(n) = my(k=1); while (sum(j=1, k, (-1)^omega(j)) != -n, k++); k; \\ Michel Marcus, Jul 19 2021

Formula

a(n) = min {k : Sum_{j=1..k} mu(rad(j)) = -n}, where mu is the Moebius function and rad is the squarefree kernel.

A368405 Infinitary version of Mertens's function: a(n) = Sum_{k=1..n} A064179(k).

Original entry on oeis.org

1, 0, -1, -2, -3, -2, -3, -2, -3, -2, -3, -2, -3, -2, -1, -2, -3, -2, -3, -2, -1, 0, -1, -2, -3, -2, -1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 1, 2, 3, 2, 1, 0, -1, 0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5
Offset: 1

Views

Author

Amiram Eldar, Dec 23 2023

Keywords

Crossrefs

Partial sums of A064179.
Similar sequences: A002321, A174863 (unitary), A209802 (exponential).

Programs

  • Mathematica
    f[p_, e_] := (-1)^DigitCount[e, 2, 1]; imu[1] = 1; imu[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[imu, 100]]
  • PARI
    imu(n) = vecprod(apply(x -> (-1)^hammingweight(x), factor(n)[, 2]));
    lista(nmax) = {my(s = 0); for(k = 1, nmax, s+ = imu(k); print1(s, ", "));}

A300270 a(n) = Sum_{1 <= i <= j <= n} mu(i*j)*floor((n/i)/j).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, 12, 12, 13, 13, 13, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 20, 20, 21, 22, 23, 23, 24, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 32, 32, 33, 34, 34, 35, 35, 35, 36, 37, 37, 37, 38, 38, 39, 40, 41, 42, 42, 42, 43, 43, 44, 44, 44, 45, 46, 47, 48, 48, 48
Offset: 1

Views

Author

Benoit Cloitre, Mar 01 2018

Keywords

Comments

We have Sum_{k=1..n} mu(k)*floor(n/k) = 1 and lim_{n -> infinity} Sum_{1 <= i <= j <= n} (mu(i*j)/i)/j = 1/2.

Crossrefs

Programs

  • PARI
    a(n) = sum(j=1, n, sum(i=1, j, moebius(i*j)*floor(n/i/j)))

Formula

a(n) ~ n/2 (n->infinity).
a(n) = (A174863(n) + n)/2. - Ridouane Oudra, May 16 2025
Showing 1-10 of 10 results.