login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = A227872(n) - A356018(n).
4

%I #11 Oct 14 2022 09:23:42

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

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

%U 0,0,2,0,0,4,0,-4,2,4,-2,6,2,0,2,0,-1,4,0

%N a(n) = A227872(n) - A356018(n).

%C The excess of the number of odious (A000069) divisors of n over the number of evil (A001969) divisors of n.

%C Every integer occurs in this sequence.

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

%F a(n) = -Sum_{d|n} A106400(d).

%F a(n) = A000005(n) - 2*A356018(n).

%F a(n) = 2*A227872(n) - A000005(n).

%F a(n) = 0 iff n is in A230851.

%F a(n) == 1 (mod 2) iff n is a square (A000290).

%F a(2^n) = n + 1.

%F a(p*2^n) = 0 when p is an evil prime (A027699).

%F 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.

%F a(p^2*2^n) = -(n+1) when p is an evil prime and p^2 is also evil.

%F a(p^2*2^n) = 3*(n+1) when p is an odd odious prime and p^2 is also odious.

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = -Sum_{k>=1} A106400(k)/k = 1.196283264... (A357762).

%t a[n_] := -DivisorSum[n, (-1)^DigitCount[#, 2, 1] &]; Array[a, 100]

%o (PARI) a(n) = -sumdiv(n, d, (-1)^hammingweight(d));

%Y Cf. A000005, A000069, A000290 (positions of odd terms), A001969, A027697, A027699, A106400, A227872, A230851 (positions of 0's), A356018, A357762.

%Y Similar sequences: A046660, A048272.

%K sign,base,easy

%O 1,2

%A _Amiram Eldar_, Oct 12 2022