%I #24 Jul 25 2023 20:24:42
%S -1,0,-1,1,-1,2,-2,2,1,2,-2,5,-2,2,1,3,-1,6,-2,5,3,2,-3,8,0,2,1,6,-3,
%T 10,-4,4,4,2,3,11,-2,2,2,8,-2,12,-3,6,7,2,-4,11,1,6,1,6,-3,10,1,10,2,
%U 2,-4,19,-4,2,5,5,4,12,-2,5,4,12,-3,16,-2,2,8,6
%N A000120-deficiency of n.
%H Reinhard Zumkeller, <a href="/A192895/b192895.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = Sum(A000120(d): 1 <= d < n and n mod d = 0) - A000120(n); see A175522 for motivation and more information;
%F a(A175524(n)) < 0; a(A175522(n)) = 0; a(A175526(n)) > 0.
%F a(n) = A292257(n) - A000120(n). - _Antti Karttunen_, Nov 10 2017
%t a[n_] := DivisorSum[n, Total[IntegerDigits[#, 2]]*(-1)^Boole[# == n]&]; Array[a, 80] (* _Jean-François Alcover_, Dec 05 2015, adapted from PARI *)
%o (Haskell)
%o a192895 n =
%o sum (map a000120 $ filter ((== 0) . (mod n)) [1..n-1]) - a000120 n
%o a192895_list = map a192895 [1..]
%o (PARI) a(n)=sumdiv(n,d,hammingweight(d)*(-1)^(d==n)) \\ _Charles R Greathouse IV_, Feb 07 2013
%o (Python)
%o from sympy import divisors
%o def A192895(n): return sum((d.bit_count() if d<n else -d.bit_count()) for d in divisors(n,generator=True)) # _Chai Wah Wu_, Jul 25 2023
%Y Cf. A000120, A033879, A093653, A175522, A175524, A175526, A292257.
%Y Cf. A257691 (positions where a(n) <= 0), A294905 (and its char.fun).
%K sign
%O 1,6
%A _Reinhard Zumkeller_, Jul 12 2011