login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A007421
Liouville's function: parity of number of primes dividing n (with multiplicity).
(Formerly M0067)
7
2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1
OFFSET
1,1
REFERENCES
J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 279.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
H. Gupta, On a table of values of L(n), Proceedings of the Indian Academy of Sciences. Section A, 12 (1940), 407-409. [Annotated scanned copy]
R. S. Lehman, On Liouville's function, Math. Comp., 14 (1960), 311-320.
FORMULA
a(n) = ((-1)^bigomega(n)+3)/2, where bigomega(n) is the number of prime divisors of the integer n counted with multiplicity.
a(n) = A065043(n) + 1.
a(n) = 2 - A001222(n) mod 2. - Reinhard Zumkeller, Nov 10 2011
MATHEMATICA
a[1] = 2; a[n_] := ((-1)^Total[FactorInteger[n][[All, 2]]] + 3)/2; (* or, from version 7 on : *) a[n_] := Boole[ EvenQ[ PrimeOmega[n]]] + 1; (* or *) a[n_] := (LiouvilleLambda[n] + 3)/2; a[1] = 2; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Apr 08 2013, updated Jan 27 2015 *)
PROG
(Haskell)
a007421 = (2 -) . (`mod` 2) . a001222 -- Reinhard Zumkeller, Nov 10 2011
CROSSREFS
Sequence in context: A245933 A268318 A309414 * A239228 A346080 A103921
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from Vladeta Jovovic, Dec 01 2001
STATUS
approved