login
A376139
a(n) = (-1)^A051903(n).
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, -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, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1
OFFSET
1
COMMENTS
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.
FORMULA
a(n) = 1 if and only if n is in A368714.
a(n) = -1 if n is a squarefree number (A005117) that is larger than 1.
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... .
MATHEMATICA
a[n_] := (-1)^If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; Array[a, 100]
PROG
(PARI) a(n) = (-1)^if(n == 1, 0, vecmax(factor(n)[, 2]));
(Python)
from sympy import factorint
def A376139(n): return -1 if max(factorint(n).values(), default=0)&1 else 1 # Chai Wah Wu, Sep 12 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Amiram Eldar, Sep 11 2024
STATUS
approved