A346202 a(n) = L(n)^2, where L is Liouville's function.
1, 0, 1, 0, 1, 0, 1, 4, 1, 0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 16, 9, 4, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 25, 16, 9, 4, 9, 4, 1, 0, 1, 4, 9, 16, 25, 16, 25, 36, 25, 36, 25, 36, 49, 36, 25, 16, 9, 4, 9, 4, 9, 4, 9, 4, 1, 4, 9, 16, 9, 16, 25, 36, 49, 36, 49, 64, 49
Offset: 1
Keywords
References
- Peter Borwein, Stephen Choi, Brendan Rooney, and Andrea Weirathmueller, The Riemann Hypothesis: A Resource for the Afficionado and Virtuoso Alike, 2007, page 6, Theorem 1.2.
Programs
-
Maple
L:= proc(n) option remember; `if`(n<1, 0, (-1)^numtheory[bigomega](n)+L(n-1)) end: a:= n-> L(n)^2: seq(a(n), n=1..77); # Alois P. Heinz, Jul 28 2021
-
Mathematica
Table[Sum[LiouvilleLambda[n], {n, 1, nn}]^2, {nn, 1, 77}]
-
PARI
a008836(n) = (-1)^bigomega(n) \\ after Charles R Greathouse IV in A008836 a(n) = sum(i=1, n, sum(j=1, n, a008836(i)*a008836(j))) \\ Felix Fröhlich, Jul 10 2021
-
Python
from functools import reduce from operator import ixor from sympy import factorint def A346202(n): return sum(-1 if reduce(ixor, factorint(i).values(),0)&1 else 1 for i in range(1,n+1))**2 # Chai Wah Wu, Dec 20 2022
Formula
a(n) = A002819(n)^2. - Ilya Gutkovskiy, Jul 10 2021
Comments