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.

A380049 Partial sums of A072203.

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 9, 12, 14, 15, 17, 20, 24, 27, 29, 30, 32, 35, 39, 44, 48, 51, 55, 58, 60, 61, 63, 66, 70, 75, 81, 88, 94, 99, 103, 106, 110, 113, 115, 116, 118, 121, 125, 130, 136, 141, 147, 154, 160, 167, 173, 180, 188, 195, 201, 206, 210, 213, 217, 220, 224, 227, 231, 234, 236
Offset: 1

Views

Author

Tsuyoshi Hanatate, Jan 10 2025

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate[Accumulate[Table[-LiouvilleLambda[n], {n, 2, 100}]]] (* Vaclav Kotesovec, Jan 15 2025 *)
  • PARI
    f(n) = 1 - sum(i=1, n, (-1)^bigomega(i)); \\ A072203
    a(n) = sum(k=1, n, f(k)); \\ Michel Marcus, Feb 06 2025

Formula

a(n) = Sum_{k=1..n} A072203(k).
Conjecture: The average value of a(n) is 2*n^(3/2)/(-3*zeta(1/2)). - Vaclav Kotesovec, Jan 15 2025

A066829 Parity of Omega(n): a(n) = 1 if n is the product of an odd number of primes; 0 if product of even number of primes.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0
Offset: 1

Views

Author

G. L. Honaker, Jr., Jan 17 2002

Keywords

Comments

From Reinhard Zumkeller, Jul 01 2009: (Start)
The first N Terms are constructed by the following sieving process:
for j:=1 until N do a(j):=0,
for i:=1 until N/2 do
for j:=2*i step i until N do a(j):=1-a(i). (End)
Omega is also written in the OEIS as bigomega. See also comments, references and formulas in A008836 (Liouville's lambda), A007421 and A065043, that all contain the same information as this sequence. - Antti Karttunen, Apr 30 2022

Examples

			From _Reinhard Zumkeller_, Jul 01 2009: (Start)
Sieve for N = 30, also demonstrating the affinity to the Sieve of Eratosthenes:
[initial] a(j):=0, 1<=j<=30:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[i=1] a(1)=0 --> a(j):=1, 2<=j<=30:
0 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
[i=2] a(2)=1 --> a(2*j):=0, 2<=j<=[30/2]:
0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
[i=3] a(3)=1 --> a(3*j):=0, 2<=j<=[30/3]:
0 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0
[i=4] a(4)=0 --> a(4*j):=1, 2<=j<=[30/4]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 0
[i=5] a(5)=1 --> a(5*j):=0, 2<=j<=[30/5]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0
[i=6] a(6)=0 --> a(6*j):=1, 2<=j<=[30/6]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 1
[i=7] a(7)=1 --> a(7*j):=0, 2<=j<=[30/7]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1
[i=8] a(8)=1 --> a(8*j):=0, 2<=j<=[30/8]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 1
[i=9] a(9)=0 --> a(9*j):=1, 2<=j<=[30/9]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 1 1
[i=10] a(10)=0 --> a(10*j):=1, 2<=j<=[30/10]:
0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 1 1
and so on: a(22):=0 in [i=11], a(24):=0 in [i=12], a(26):=0 in [i=13], a(28):=1 in [i=14], and a(30):=1 in [i=15]. (End)
		

Crossrefs

Characteristic function of A026424 (positions of 1's). Cf. also A028260 (its complement, positions of 0's).
Cf. A001222 (bigomega), A007421, A008836, A055038 (partial sums), A065043, A069545 (run lengths), A072203, A349905, A353556, A353558, A358751, A358753.
Cf. A000035.

Programs

  • Haskell
    a066829 = (`mod` 2) . a001222 -- Reinhard Zumkeller, Nov 19 2011
    
  • Maple
    A066829 := proc(n)
        modp(numtheory[bigomega](n) ,2) ;
    end proc:
    seq(A066829(n),n=1..80) ; # R. J. Mathar, Jul 15 2017
  • Mathematica
    Table[(1-LiouvilleLambda[n])/2,{n,1,20}] (* Enrique Pérez Herrero, Jul 07 2012 *)
    Table[If[OddQ[PrimeOmega[n]],1,0],{n,120}] (* Harvey P. Dale, Mar 12 2016 *)
  • PARI
    A066829(n) = (bigomega(n)%2); \\ Simplified by Antti Karttunen, Apr 30 2022
    
  • Python
    from sympy import primeomega as Omega
    def a(n): return Omega(n)%2
    print([a(n) for n in range(1, 105)]) # Michael S. Branicky, Apr 30 2022
    
  • Python
    from operator import ixor
    from functools import reduce
    from sympy import factorint
    def A066829(n): return reduce(ixor, factorint(n).values(),0)&1 # Chai Wah Wu, Jan 01 2023

Formula

a(A026424(n)) = 1; a(A028260(n)) = 0.
Dirichlet g.f.: (zeta(s)^2 - zeta(2*s)) / (2*zeta(s)). [Typo corrected by Vaclav Kotesovec, Jan 30 2024]
a(n) = (1-A008836(n)) / 2. - Corrected by Antti Karttunen, Apr 30 2022
a(m*n) = a(m) XOR a(n). - Reinhard Zumkeller, Aug 28 2008
a(n) = A001222(n) mod 2. - Reinhard Zumkeller, Nov 19 2011
From Antti Karttunen, May 01 & Nov 30 2022: (Start)
a(n) = 1 - A065043(n) = A349905(n) mod 2.
a(n) = A353556(n) + A353558(n).
a(n) = A358751(n) + A358753(n). (End)
a(n) = A000035(A001222(n)). - Omar E. Pol, Apr 09 2025

Extensions

Corrected and comment added by Reinhard Zumkeller, Jun 26 2009

A002053 a(n) = least value of m for which Liouville's function A002819(m) = -n.

Original entry on oeis.org

2, 3, 8, 13, 20, 31, 32, 53, 76, 79, 80, 117, 176, 181, 182, 193, 200, 283, 284, 285, 286, 293, 440, 443, 468, 661, 678, 683, 684, 1075, 1076, 1087, 1088, 1091, 1092, 1093, 1106, 1109, 1128, 1129, 1130, 1131, 1132, 1637, 1638, 1753, 1756, 1759, 1760, 2699
Offset: 0

Views

Author

Keywords

Comments

Also when n first appears in A072203(m).

References

  • H. Gupta, On a table of values of L(n), Proceedings of the Indian Academy of Sciences. Section A, 12 (1940), 407-409.
  • H. Gupta, A table of values of Liouville's function L(n), Research Bulletin of East Panjab University, No. 3 (Feb. 1950), 45-55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = f[n - 1] -(-1)^Length[Flatten[Table[ #[[1]], {#[[2]]}] & /@ FactorInteger[n]]]; f[1] = 0; Do[k = 1; While[f[k] != n, k++ ]; Print[k], {n, 1, 50}]
  • Python
    from functools import reduce
    from operator import ixor
    from itertools import count
    from sympy import factorint
    def A002053(n): return next(filter(lambda m:-n==sum(-1 if reduce(ixor, factorint(i).values(),0)&1 else 1 for i in range(1,m+1)),count(1))) # Chai Wah Wu, Jan 01 2023

Extensions

More terms from Jud McCranie

A123066 (Number of numbers <= n with an odd number of distinct prime factors) - (number of numbers <= n with an even number of distinct prime factors).

Original entry on oeis.org

0, 1, 2, 3, 4, 3, 4, 5, 6, 5, 6, 5, 6, 5, 4, 5, 6, 5, 6, 5, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 7, 6, 5, 4, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 1, 2, 1, 0, -1, 0, -1, -2, -3, -4, -5, -4, -3, -2, -3, -4, -3, -4, -3, -2, -3, -4, -3, -2, -3, -2, -3, -4, -5, -6, -5, -4, -5, -4, -5, -4, -3, -4, -5, -6, -7, -6, -5, -6, -7, -8, -9, -10
Offset: 1

Views

Author

Keywords

Comments

Analog of A072203 for number of distinct factors. Conjecture that sequence changes sign infinitely often, although the next sign change is probably large.
The signs first change at n = 52 and then change again at n = 7954. - Harvey P. Dale, Jul 04 2012

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 0, a(n-1)+
          `if`(nops(ifactors(n)[2])::odd, 1, -1))
        end:
    seq(a(n), n=1..120);  # Alois P. Heinz, Dec 21 2018
  • Mathematica
    dpf[n_] := Module[{df = PrimeNu[n]}, If[OddQ[df], 1, -1]]; Join[{0}, Accumulate[ Array[dpf, 100, 2]]] (* Harvey P. Dale, Jul 04 2012 *)
  • Python
    from sympy import primenu
    def A123066(n): return 1+sum(1 if primenu(i)&1 else -1 for i in range(1,n+1)) # Chai Wah Wu, Dec 31 2022

Formula

a(n) = Sum_{k>=1} (-1)^(k-1) * A346617(n,k). - Alois P. Heinz, Aug 19 2021
Showing 1-4 of 4 results.