login
a(n) = (-1)^A051903(n).
1

%I #12 Sep 12 2024 15:28:27

%S 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,

%T -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,

%U -1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1

%N a(n) = (-1)^A051903(n).

%C The asymptotic density of the occurrences of 1's is Sum_{k>=2} (-1)^k * (1 - 1/zeta(k)) = 0.27591672059822700769..., which is the asymptotic density of A368714.

%H Amiram Eldar, <a href="/A376139/b376139.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.

%F a(n) = 1 if and only if n is in A368714.

%F a(n) = -1 if n is a squarefree number (A005117) that is larger than 1.

%F Asymptotic mean: c = Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2 * (Sum_{k>=2} (-1)^k * (1 - 1/zeta(k))) - 1 = -0.44816655880354598461... . The asymptotic standard deviation of this sequence is sqrt(1-c^2) = 0.89395007442820192379... .

%t a[n_] := (-1)^If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; Array[a, 100]

%o (PARI) a(n) = (-1)^if(n == 1, 0, vecmax(factor(n)[,2]));

%o (Python)

%o from sympy import factorint

%o def A376139(n): return -1 if max(factorint(n).values(),default=0)&1 else 1 # _Chai Wah Wu_, Sep 12 2024

%Y Cf. A005117, A051903, A368714.

%K sign,easy

%O 1

%A _Amiram Eldar_, Sep 11 2024