login
a(n) = Sum_{k=1..n} (-1)^(k-Omega(k)) with Omega(k) the total number of prime factors of k (counted with multiplicity).
2

%I #57 Aug 31 2023 08:14:52

%S -1,-2,-1,0,1,2,3,2,1,2,3,2,3,4,3,4,5,4,5,4,3,4,5,6,5,6,7,6,7,6,7,6,5,

%T 6,5,6,7,8,7,8,9,8,9,8,9,10,11,10,9,8,7,6,7,8,7,8,7,8,9,10

%N a(n) = Sum_{k=1..n} (-1)^(k-Omega(k)) with Omega(k) the total number of prime factors of k (counted with multiplicity).

%C On May 16 2012, _Zhi-Wei Sun_ conjectured that a(n) is positive for each n > 4. He has verified this for n up to 10^10, and shown that the conjecture implies the Riemann Hypothesis. Moreover, he guessed that a(n) > sqrt(n) for any n > 324 (and also a(n) < sqrt(n)*log(log(n)) for n > 5892); this implies that the sequence contains all natural numbers.

%C Sun also conjectured that b(n) = Sum_{k=1..n} (-1)^(k-Omega(k))/k < 0 for all n=1,2,3,..., and verified this for n up to 2*10^9. Moreover, he guessed that b(n) < -1/sqrt(n) for all n > 1, and b(n) > -log(log(n))/sqrt(n) for n > 2008.

%H Zhi-Wei Sun, <a href="/A212496/b212496.txt">Table of n, a(n) for n = 1..10000</a>

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1204.6689">On a pair of zeta functions</a>, preprint, arxiv:1204.6689 [math.NT], 2012-2016.

%H Zhi-Wei Sun, <a href="http://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;b3990068.1205">On the parities of Omega(n)-n</a>, a message to Number Theory List, May 18, 2012.

%H Zhi-Wei Sun, <a href="http://math.nju.edu.cn/~zwsun/b212496.rar">Table of n, a(n) for n = 1..10^7</a> (rar-compressed)

%e We have a(4)=0 since (-1)^(1-Omega(1)) + (-1)^(2-Omega(2)) + (-1)^(3-Omega(3)) + (-1)^(4-Omega(4)) = -1 - 1 + 1 + 1 = 0.

%p ListTools:-PartialSums([seq((-1)^(k-numtheory:-bigomega(k)),k=1..60)]); # _Robert Israel_, Jan 03 2023

%t PrimeDivisor[n_]:=Part[Transpose[FactorInteger[n]],1]

%t Omega[n_]:=If[n==1,0,Sum[IntegerExponent[n,Part[PrimeDivisor[n],i]],{i,1,Length[PrimeDivisor[n]]}]]

%t s[0]=0

%t s[n_]:=s[n]=s[n-1]+(-1)^(n-Omega[n])

%t Do[Print[n," ",s[n]],{n,1,100000}]

%t Accumulate[Table[(-1)^(n-PrimeOmega[n]),{n,1000}]] (* _Harvey P. Dale_, Oct 07 2013 *)

%o (PARI) a(n)=sum(k=1,n, (-1)^(bigomega(k)+k)) \\ _Charles R Greathouse IV_, Jul 31 2016

%o (Python)

%o from functools import reduce

%o from operator import ixor

%o from sympy import factorint

%o def A212496(n): return sum(-1 if reduce(ixor, factorint(i).values(),i)&1 else 1 for i in range(1,n+1)) # _Chai Wah Wu_, Jan 03 2023

%Y Cf. A008836, A002819.

%K sign,nice

%O 1,2

%A _Zhi-Wei Sun_, May 19 2012