[go: up one dir, main page]

login
A357761
a(n) = A227872(n) - A356018(n).
4
1, 2, 0, 3, 0, 0, 2, 4, -1, 0, 2, 0, 2, 4, -2, 5, 0, -2, 2, 0, 2, 4, 0, 0, 1, 4, -2, 6, 0, -4, 2, 6, 0, 0, 2, -3, 2, 4, 0, 0, 2, 4, 0, 6, -4, 0, 2, 0, 3, 2, -2, 6, 0, -4, 2, 8, 0, 0, 2, -6, 2, 4, 0, 7, 0, 0, 2, 0, 0, 4, 0, -4, 2, 4, -2, 6, 2, 0, 2, 0, -1, 4, 0
OFFSET
1,2
COMMENTS
The excess of the number of odious (A000069) divisors of n over the number of evil (A001969) divisors of n.
Every integer occurs in this sequence.
LINKS
FORMULA
a(n) = -Sum_{d|n} A106400(d).
a(n) = A000005(n) - 2*A356018(n).
a(n) = 2*A227872(n) - A000005(n).
a(n) = 0 iff n is in A230851.
a(n) == 1 (mod 2) iff n is a square (A000290).
a(2^n) = n + 1.
a(p*2^n) = 0 when p is an evil prime (A027699).
a(p^2*2^n) = n + 1 when p is an evil prime (A027699) and p^2 is odious, and when p is an odd odious prime (A027697) and p^2 is evil.
a(p^2*2^n) = -(n+1) when p is an evil prime and p^2 is also evil.
a(p^2*2^n) = 3*(n+1) when p is an odd odious prime and p^2 is also odious.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = -Sum_{k>=1} A106400(k)/k = 1.196283264... (A357762).
MATHEMATICA
a[n_] := -DivisorSum[n, (-1)^DigitCount[#, 2, 1] &]; Array[a, 100]
PROG
(PARI) a(n) = -sumdiv(n, d, (-1)^hammingweight(d));
CROSSREFS
Cf. A000005, A000069, A000290 (positions of odd terms), A001969, A027697, A027699, A106400, A227872, A230851 (positions of 0's), A356018, A357762.
Similar sequences: A046660, A048272.
Sequence in context: A357887 A359586 A035205 * A284823 A131104 A141701
KEYWORD
sign,base,easy
AUTHOR
Amiram Eldar, Oct 12 2022
STATUS
approved