%I #19 Jul 29 2017 00:09:48
%S 0,0,1,0,0,1,1,0,0,0,2,1,1,1,1,0,0,0,1,0,0,2,2,1,1,1,2,1,1,1,1,0,0,0,
%T 1,0,0,1,1,0,0,0,3,2,2,2,2,1,1,1,2,1,1,2,2,1,1,1,2,1,1,1,1,0,0,0,1,0,
%U 0,1,1,0,0,0,2,1,1,1,1,0,0,0,1,0,0,3,3,2,2,2,3,2,2,2,2,1
%N Number of minus ones in the symmetric signed digit expansion of n with q=2 (i.e., the representation of n in the (-1,0,1)_2 number system).
%H C. Heuberger and H. Prodinger, <a href="http://dx.doi.org/10.1007/s006070170021">On minimal expansions in redundant number systems: Algorithms and quantitative analysis</a>, Computing 66(2001), 377-393.
%o (PARI) ep(r, n)=local(t=n/2^(r+2)); floor(t+5/6)-floor(t+4/6)-floor(t+2/6)+floor(t+1/6);
%o a(n)=sum(r=0, log(3*n)\log(2)-1, (ep(r, n) == 1)) ;
%Y Cf. A005578, A085423, A007302 (nonzeros), A057526 (0's), A085424 (1's).
%K nonn,easy,base
%O 1,11
%A _Ralf Stephan_, Jun 30 2003
|