LiouvilleLambda¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
LiouvilleLambda[n] gives the Liouville function lambda(n) = (-1)^Omega(n), where Omega(n) counts the prime factors of n with multiplicity. Completely multiplicative. A non-real Gaussian-integer argument, or GaussianIntegers -> True, is handled over Z[i].
Examples (6)¶
Every input below was run against the current Mathilda build and its output recorded.
Basic examples (5)¶
In[1]:= LiouvilleLambda[8]
Out[1]= -1
In[2]:= LiouvilleLambda[9]
Out[2]= 1
In[3]:= LiouvilleLambda[{1, 2, 3, 4, 5, 6}]
Out[3]= {1, -1, -1, 1, -1, 1}
In[4]:= LiouvilleLambda[10^30 + 1]
Out[4]= -1
In[5]:= LiouvilleLambda[2 + I]
Out[5]= -1
Options (1)¶
Implementation notes¶
Listable,Protected.- Completely multiplicative:
lambda(m n) = lambda(m) lambda(n). - Computed directly from the prime factorisation (machine integers and GMP
bigints handled uniformly); the result is always
1or-1. - The sign of
nis ignored (lambda(-n) = lambda(n)). - Gaussian integers:
LiouvilleLambda[n, GaussianIntegers -> True], or a non-real Gaussian-integer argumentComplex[a, b], factorsnoverZ[i]and counts the Gaussian prime factors with multiplicity. Because2factors as-i (1 + i)^2inZ[i], e.g.LiouvilleLambda[2, GaussianIntegers -> True]is1whileLiouvilleLambda[2]is-1. - Non-integer or zero
nis left unevaluated; a wrong argument count issues aLiouvilleLambda::argtmessage.
Attributes: Listable, Protected.
References¶
- Source:
src/info.c - Specification:
docs/spec/builtins/number-theory.md - Tests:
tests/test_liouvillelambda.c - Tests:
tests/test_primenu.c - Tests:
tests/test_sum_product_families.c