login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
AUTHOR
EXTENSIONS
More terms from Vladeta Jovovic, Dec 01 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:23 EDT 2024. Contains 371989 sequences. (Running on oeis4.)