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

A008836 Liouville's function lambda(n) = (-1)^k, where k is number of primes dividing n (counted with multiplicity).

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, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1
Offset: 1

Views

Author

Keywords

Comments

Coons and Borwein: "We give a new proof of Fatou's theorem: if an algebraic function has a power series expansion with bounded integer coefficients, then it must be a rational function. This result is applied to show that for any non-trivial completely multiplicative function from N to {-1,1}, the series sum_{n=1..infinity} f(n)z^n is transcendental over {Z}[z]; in particular, sum_{n=1..infinity} lambda(n)z^n is transcendental, where lambda is Liouville's function. The transcendence of sum_{n=1..infinity} mu(n)z^n is also proved." - Jonathan Vos Post, Jun 11 2008
Coons proves that a(n) is not k-automatic for any k > 2. - Jonathan Vos Post, Oct 22 2008
The Riemann hypothesis is equivalent to the statement that for every fixed epsilon > 0, lim_{n -> infinity} (a(1) + a(2) + ... + a(n))/n^(1/2 + epsilon) = 0 (Borwein et al., theorem 1.2). - Arkadiusz Wesolowski, Oct 08 2013

Examples

			a(4) = 1 because since bigomega(4) = 2 (the prime divisor 2 is counted twice), then (-1)^2 = 1.
a(5) = -1 because 5 is prime and therefore bigomega(5) = 1 and (-1)^1 = -1.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 37.
  • P. Borwein, S. Choi, B. Rooney and A. Weirathmueller, The Riemann Hypothesis: A Resource for the Aficionado and Virtuoso Alike, Springer, Berlin, 2008, pp. 1-11.
  • 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.
  • P. Ribenboim, Algebraic Numbers, p. 44.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 279.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.3.5 on page 99.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 112.

Crossrefs

Möbius transform of A010052.
Cf. A182448 (Dgf at s=2), A347328 (Dgf at s=3), A347329 (Dgf at s=4).

Programs

  • Haskell
    a008836 = (1 -) . (* 2) . a066829  -- Reinhard Zumkeller, Nov 19 2011
    
  • Maple
    A008836 := n -> (-1)^numtheory[bigomega](n); # Peter Luschny, Sep 15 2011
    with(numtheory): A008836 := proc(n) local i,it,s; it := ifactors(n): s := (-1)^add(it[2][i][2], i=1..nops(it[2])): RETURN(s) end:
  • Mathematica
    Table[LiouvilleLambda[n], {n, 100}] (* Enrique Pérez Herrero, Dec 28 2009 *)
    Table[If[OddQ[PrimeOmega[n]],-1,1],{n,110}] (* Harvey P. Dale, Sep 10 2014 *)
  • PARI
    {a(n) = if( n<1, 0, n=factor(n); (-1)^sum(i=1, matsize(n)[1], n[i,2]))}; /* Michael Somos, Jan 01 2006 */
    
  • PARI
    a(n)=(-1)^bigomega(n) \\ Charles R Greathouse IV, Jan 09 2013
    
  • Python
    from sympy import factorint
    def A008836(n): return -1 if sum(factorint(n).values()) % 2 else 1 # Chai Wah Wu, May 24 2022

Formula

Dirichlet g.f.: zeta(2s)/zeta(s); Dirichlet inverse of A008966.
Sum_{ d divides n } lambda(d) = 1 if n is a square, otherwise 0.
Completely multiplicative with a(p) = -1, p prime.
a(n) = (-1)^A001222(n) = (-1)^bigomega(n). - Jonathan Vos Post, Apr 16 2006
a(n) = A033999(A001222(n)). - Jaroslav Krizek, Sep 28 2009
Sum_{d|n} a(d) *(A000005(d))^2 = a(n) *Sum{d|n} A000005(d). - Vladimir Shevelev, May 22 2010
a(n) = 1 - 2*A066829(n). - Reinhard Zumkeller, Nov 19 2011
a(n) = i^(tau(n^2)-1) where tau(n) is A000005 and i is the imaginary unit. - Anthony Browne, May 11 2016
a(n) = A106400(A156552(n)). - Antti Karttunen, May 30 2017
Recurrence: a(1)=1, n > 1: a(n) = sign(1/2 - Sum_{dMats Granvik, Oct 11 2017
a(n) = Sum_{ d | n } A008683(d)*A010052(n/d). - Jinyuan Wang, Apr 20 2019
a(1) = 1; a(n) = -Sum_{d|n, d < n} mu(n/d)^2 * a(d). - Ilya Gutkovskiy, Mar 10 2021
a(n) = (-1)^A349905(n). - Antti Karttunen, Apr 26 2022
From Ridouane Oudra, Jun 02 2024: (Start)
a(n) = (-1)^A066829(n);
a(n) = (-1)^A063647(n);
a(n) = A101455(A048691(n));
a(n) = sin(tau(n^2)*Pi/2). (End)

A065043 Characteristic function of the numbers with an even number of prime factors (counted with multiplicity): a(n) = 1 if n = A028260(k) for some k then 1 else 0.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 05 2001

Keywords

Crossrefs

Characteristic function of A028260 (positions of 1's). Cf. also A026424 (positions of 0's) and A320655.
One less than A007421.
Cf. also A066829, A353374.

Programs

  • Maple
    A065043 := proc(n)
        if type(numtheory[bigomega](n),'even') then
            1;
        else
            0;
        end if;
    end proc: # R. J. Mathar, Jun 26 2013
  • Mathematica
    Table[(LiouvilleLambda[n]+1)/2,{n,1,20}] (* Enrique Pérez Herrero, Jul 07 2012 *)
  • PARI
    { for (n=1, 1000, a=1 - bigomega(n)%2; write("b065043.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 04 2009
    
  • PARI
    A065043(n) = (1 - (bigomega(n)%2)); \\ Antti Karttunen, Apr 19 2022
    
  • Python
    from operator import ixor
    from functools import reduce
    from sympy import factorint
    def A065043(n): return (reduce(ixor, factorint(n).values(),0)&1)^1 # Chai Wah Wu, Jan 01 2023

Formula

a(n) = 1 - A001222(n) mod 2.
a(n) = A007421(n) - 1.
a(n) = 1 - A066829(n).
a(A028260(k)) = 1 and a(A026424(k)) = 0 for all k.
Dirichlet g.f.: (zeta(s)^2 + zeta(2*s))/(2*zeta(s)). - Enrique Pérez Herrero, Jul 06 2012
a(n) = (A008836(n) + 1)/2. - Enrique Pérez Herrero, Jul 07 2012
a(n) = A001222(2n) mod 2. - Wesley Ivan Hurt, Jun 22 2013
G.f.: Sum_{n>=1} a(n)*x^n/(1 - x^n) = Sum_{n>=1} x^(n^2)/(1 - x^n). - Ilya Gutkovskiy, Apr 25 2017
From Antti Karttunen, Dec 01 2022: (Start)
For x, y >= 1, a(x*y) = 1 - abs(a(x)-a(y)).
a(n) = a(A046523(n)) = A356163(A003961(n)).
a(n) = A000035(A356163(n)+A347102(n)).
a(n) = A010052(n) + A353669(n).
a(n) = A353555(n) + A353557(n).
a(n) = A358750(n) + A358752(n).
a(n) = A353374(n) + A358775(n).
a(n) >= A356170(n).
(End)

Extensions

Corrected by Charles R Greathouse IV, Sep 02 2009

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

A174351 a(n) = lambda(Fibonacci(n)).

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
Offset: 1

Views

Author

Michel Lagneau, Mar 16 2010

Keywords

Examples

			L(Fibonacci(1))= L(Fibonacci(2))= L(1)= 1.
L(Fibonacci(3))= L(2) = -1.
L(Fibonacci(12))= L(144)= 1.
		

Crossrefs

Programs

Formula

a(n) = A008836(A000045(n)).

Extensions

Examples edited by Harvey P. Dale, Dec 02 2022

A288118 Lexicographically earliest sequence of distinct positive terms such that, for any i and j > 0, a(i*j) != a(i) * a(j).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 05 2017

Keywords

Comments

If we drop the unicity constraint, then we obtain the Liouville's function (A007421).
This sequence is a permutation of the natural numbers (we can always choose the least value not yet seen at prime positions).
Conjecturally:
- the sequence is self-inverse,
- | a(n) - n | <= 1 for any n > 0,
- | a(i)*a(j) - i*j | <> 1 for any i > 0 and j > 0,
- a(n) = n+1 iff a(n+1) = n.
a(6) = a(1) * a(2) * a(3).
This sequence has connections with A288119; here we avoid a(i)*a(j) = a(i*j), there a(i)+a(j) = a(i*j).

Examples

			a(1) cannot equal 1 as a(1*1) != a(1)*a(1); a(1) = 2 is acceptable.
a(2) cannot equal a(1); a(2) = 1 is acceptable.
a(3) cannot equal a(1), a(2); a(3) = 3 is acceptable.
a(4) cannot equal a(1)...a(3), a(2)^2; a(4) = 5 is acceptable.
a(5) cannot equal a(1)...a(4); a(5) = 4 is acceptable.
a(6) cannot equal a(1)...a(5), a(2)*a(3); a(6) = 6 is acceptable.
		

Crossrefs

A175702 Convolution square of the Liouville sequence A008836.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Aug 10 2010

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory): T:=array(1..200):for p from 1 to 200 do: T[p] :=(-1)^bigomega(p): od :for n from 1 to 100 do: printf(`%d, `, sum (T[k]*T[n+1-k],k=1..n)):od:

Formula

a(n)= Sum_{k=1..n} lambda(k)*lambda(n+1-k).

Extensions

Definition slightly rephrased, keyword:sign added - R. J. Mathar, Aug 19 2010
Showing 1-6 of 6 results.