Liouville's function and triangular numbers

Jon Maiga, 2018-11-23

This article describes a small observation I made between consecutive terms of Liouville’s function and the triangular numbers, namely

λ(n)=λ(n+1)    λ(n(n+1)2)=1\lambda(n)=\lambda(n+1) \iff \lambda(\frac{n(n+1)}{2})=-1

Liouville's function

The Liouville function, λ(n)\lambda(n), denotes the parity of the number of prime factors of n,

λ(n)=(1)Ω(n)\lambda(n)=(-1)^{\Omega(n)}

where Omega, Ω(n)\Omega(n) is the number of prime divisors of n.

λ(n)={1,if Ω(n) is even1,if Ω(n) is odd\lambda(n) = \begin{cases} 1, & \text{if $\Omega(n)$ is even} \\ -1, & \text{if $\Omega(n)$ is odd} \end{cases}

So for example

λ(10)=(1)Ω(52)=(1)2=1\lambda(10)=(-1)^{\Omega(5\cdot2)}=(-1)^2=1

λ(12)=(1)Ω(322)=(1)3=1\lambda(12)=(-1)^{\Omega(3\cdot2\cdot2)}=(-1)^3=-1

In oeis.org this sequence is

A008836 Liouville’s function lambda(n) = (-1)^k, where k is number of primes dividing n

Where the first few terms of λ(n)\lambda(n) are

1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1,…

The triangular numbers

To get the triangular numbers, let use Δ(n)\Delta(n), you just keep adding nn to the previous term, starting at 0: 0,0+1=1,1+2=3,3+3=6,6+4=10,....0, 0+1=1, 1+2=3, 3+3=6, 6+4=10, ....

If you want to get the nthnth triangular number directly you can use

Δ(n)=n(n+1)2\Delta(n)=\frac{n(n+1)}{2}

A000217 Triangular numbers: a(n) = binomial(n+1,2) = n(n+1)/2 = 0 + 1 + 2 + … + n.

The first few triangular numbers are
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153,…

The relationship

As usual when playing with sequencedb.net I noticed a new formula for

A221280 Numbers n such that lambda(n) = lambda(n+1).

2, 7, 9, 11, 12, 14, 15, 17, 18, 19, 21, 24, 25, 27, 28, 29,…

The procedurally found formula managed to generate A221280 by via the triangular numbers which caught my attention.

λ(n)=λ(n+1)    λ(n(n+1)2)=1\lambda(n)=\lambda(n+1) \iff \lambda(\frac{n(n+1)}{2})=-1

I verified this for 10^5 terms and felt pretty confident that this relationship holds for all n and generates the full sequence and not just a subset.

The proof

The proof is simple, what we are saying is that

λ(n)=λ(n+1)    λ(n(n+1)2)=1\lambda(n)=\lambda(n+1) \iff \lambda(\frac{n(n+1)}{2})=-1

this means (1)Ω(n(n+1)2)=1(-1)^{\Omega(\frac{n(n+1)}{2})}=-1

so Ω(n(n+1)2)\Omega(\frac{n(n+1)}{2}) has to be odd, hence, if we drop the division by 2, Ω(n(n+1))\Omega(n(n+1)) has to be even.

Now we can rewrite Ω(n(n+1))=Ω(n)+Ω(n+1)\Omega(n(n+1))=\Omega(n)+\Omega(n+1) since Ω\Omega counts the factors and the inner multiplication adds them (e.g. Ω(34)=Ω(3)+Ω(2)+Ω(2)=3\Omega(3*4)=\Omega(3)+\Omega(2)+\Omega(2)=3).

Because Ω(n(n+1))\Omega(n(n+1)) has to be even then both Ω(n)\Omega(n) and Ω(n+1)\Omega(n+1) require to be of the same parity (even=odd+odd or even+even).

Finally we put back the division of two to get to the triangular numbers again, and changing by a factor requires Ω(n(n+1)2)Ω(\frac{n(n+1)}{2}) to be odd.

Clearly the complement work as well, λ(n)λ(n+1)    λ(n(n+1)2)=1\lambda(n)\ne\lambda(n+1) \implies \lambda(\frac{n(n+1)}{2})=1.

After writing it down it seems very obvious.

Final thoughts

Is it’s possible to extend this method to λ(n)=λ(n+1)=λ(n+2)\lambda(n)=\lambda(n+1)=\lambda(n+2) or generally to any extent?

Written with StackEdit.