This site is supported by donations to The OEIS Foundation.

 Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing. Other ways to donate

 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) 6
 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 Reinhard Zumkeller, Table of n, a(n) for n = 1..1000 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) = 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 Cf. A008836. A065043(n) + 1. Sequence in context: A245933 A268318 A309414 * A239228 A103921 A115623 Adjacent sequences:  A007418 A007419 A007420 * A007422 A007423 A007424 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 14 12:04 EST 2019. Contains 329979 sequences. (Running on oeis4.)