Liouville Function

Author

Eric W. Weisstein
October 26, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/NumberTheoreticFunctions/LiouvilleFunction.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/LiouvilleFunction.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Code

r[1]:=0
r[n_]:=Total[Last/@FactorInteger[n]]
MyLiouvilleLambda[n_]:=(((-1))^(r[n]))

Plot

<<Utilities`Plot`

IntegerListPlot[LiouvilleLambda/@Range[100],
AxesLabel->TraditionalForm/@{n,λ[n]},
Ticks->{Automatic,{-1,0,1}}]

Values

l=LiouvilleLambda/@Range[30]

Position[l,-1]//Flatten

Position[l,1]//Flatten

Identities

LiouvilleLambda[n]==(((-1))^(PrimeOmega[n]))

FullSimplify[(-1)^PrimeOmega[n],n∈Integers&&n>0]

FullSimplify[(-1)^PrimeOmega[n]-LiouvilleLambda[n],n∈Integers&&n>0]

Table[(-1)^PrimeOmega[n]-LiouvilleLambda[n],{n,100}]//Union

Series

(∑_n^∞)((LiouvilleLambda[n])/(n^s))==((Zeta[2 s])/(Zeta[s]))

V7

Sum[((LiouvilleLambda[n])/(n^s)),{n,∞}]

V8

Sum[((LiouvilleLambda[n])/(n^s)),{n,∞}]

(∑_n^∞)(((LiouvilleLambda[n]) (x^n))/(1-(x^n)))==(((EllipticTheta[3, 0, x])-1)/2)

V8

Sum[((LiouvilleLambda[n](x^n))/(1-(x^n))),{n,∞}]

Series[Sum[((LiouvilleLambda[n](x^n))/(1-(x^n))),{n,100}],{x,0,100}]

Sum[(x^(n^2)),{n,∞}]

Series[(1/2) (-1+EllipticTheta[3,0,x]),{x,0,100}]

GeneratingFunction[Piecewise[{{1,n>0&&IntegerQ[Sqrt[n]]}}],n,x]

CoefficientList[%,x]

SeriesCoefficient[(1/2) (-1+EllipticTheta[3,0,x]),{x,0,n}]

Table[Piecewise[{{1,n>0&&IntegerQ[Sqrt[n]]}}],{n,0,100}]

GeneratingFunction[

Summatory

Values

LiouvilleL[1]:=1
LiouvilleL[n_]:=LiouvilleL[n]=LiouvilleLambda[n]+LiouvilleL[n-1]

LiouvilleL/@Range[20]

Take[l=Rest[FoldList[Plus,0,LiouvilleLambda/@Range[1000]]],20]

Position[l,0]//Flatten

Position[l,_?Positive]//Flatten

(Not?) Identity

(∑_(n=1)^x)L((x/n))==⌊(Sqrt[x])⌋

LiouvilleL/@Divisors[6]

Floor[Sqrt[6]]

LiouvilleL/@Divisors[12]

Floor[Sqrt[12]]

Sum[LiouvilleL[6/n],{n,6}]

Powers of 10

l=Rest[FoldList[Plus,0,LiouvilleLambda/@Range[10^6]]];//Timing

powers=l[[10^Range[0,6]]]

s=0;
Do[s+=LiouvilleLambda[n],{n,10^5}];//Timing
s

Do[s+=LiouvilleLambda[n],{n,10^5+1,10^6}];//Timing
s

Do[s+=LiouvilleLambda[n],{n,10^6+1,10^7}];//Timing
s

Do[s+=LiouvilleLambda[n],{n,10^7+1,10^8}];//Timing
s

powers={1,0,-2,-14,-94,-288,-530,-842,-3884};

Plot

ListPlot[l,PlotJoined->True,PlotStyle->Red,AxesLabel->TraditionalForm/@{n,L[n]}]