# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a007421 Showing 1-1 of 1 %I A007421 M0067 #39 May 19 2020 07:13:24 %S A007421 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, %T A007421 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, %U A007421 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 %N A007421 Liouville's function: parity of number of primes dividing n (with multiplicity). %D A007421 J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 279. %D A007421 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007421 Reinhard Zumkeller, Table of n, a(n) for n = 1..1000 %H A007421 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] %H A007421 R. S. Lehman, On Liouville's function, Math. Comp., 14 (1960), 311-320. %F A007421 a(n) = ((-1)^bigomega(n)+3)/2, where bigomega(n) is the number of prime divisors of the integer n counted with multiplicity. %F A007421 a(n) = A065043(n) + 1. %F A007421 a(n) = 2 - A001222(n) mod 2. - _Reinhard Zumkeller_, Nov 10 2011 %t A007421 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 *) %o A007421 (Haskell) %o A007421 a007421 = (2 -) . (`mod` 2) . a001222 -- _Reinhard Zumkeller_, Nov 10 2011 %Y A007421 Cf. A008836, A065043. %K A007421 nonn,easy,nice %O A007421 1,1 %A A007421 _N. J. A. Sloane_ %E A007421 More terms from _Vladeta Jovovic_, Dec 01 2001 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE