[go: up one dir, main page]

login
Liouville's function: parity of number of primes dividing n (with multiplicity).
(Formerly M0067)
7

%I M0067 #39 May 19 2020 07:13:24

%S 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 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 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 Liouville's function: parity of number of primes dividing n (with multiplicity).

%D J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 279.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Reinhard Zumkeller, <a href="/A007421/b007421.txt">Table of n, a(n) for n = 1..1000</a>

%H H. Gupta, <a href="/A002053/a002053.pdf">On a table of values of L(n)</a>, Proceedings of the Indian Academy of Sciences. Section A, 12 (1940), 407-409. [Annotated scanned copy]

%H R. S. Lehman, <a href="http://dx.doi.org/10.1090/S0025-5718-1960-0120198-5">On Liouville's function</a>, Math. Comp., 14 (1960), 311-320.

%F a(n) = ((-1)^bigomega(n)+3)/2, where bigomega(n) is the number of prime divisors of the integer n counted with multiplicity.

%F a(n) = A065043(n) + 1.

%F a(n) = 2 - A001222(n) mod 2. - _Reinhard Zumkeller_, Nov 10 2011

%t 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 (Haskell)

%o a007421 = (2 -) . (`mod` 2) . a001222 -- _Reinhard Zumkeller_, Nov 10 2011

%Y Cf. A008836, A065043.

%K nonn,easy,nice

%O 1,1

%A _N. J. A. Sloane_

%E More terms from _Vladeta Jovovic_, Dec 01 2001