login
a(n) = (number of digits <=1) - (number of digits >1) in base 4 representation of n.
3

%I #14 Jan 27 2025 07:24:50

%S 1,-1,-1,2,2,0,0,0,0,-2,-2,0,0,-2,-2,3,3,1,1,3,3,1,1,1,1,-1,-1,1,1,-1,

%T -1,1,1,-1,-1,1,1,-1,-1,-1,-1,-3,-3,-1,-1,-3,-3,1,1,-1,-1,1,1,-1,-1,

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

%N a(n) = (number of digits <=1) - (number of digits >1) in base 4 representation of n.

%F a(n) = A110591(n)-2*A139352(n). - _R. J. Mathar_, Jan 27 2025

%p A037863 := proc(n)

%p a := 0 ;

%p dgs := convert(n,base,4);

%p for i from 1 to nops(dgs) do

%p if op(i,dgs)<=1 then

%p a := a+1 ;

%p else

%p a := a-1 ;

%p end if;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, Oct 16 2015

%o (PARI) a(n) = my(d=digits(n, 4)); #select(x->(x<=1), d) - #select(x->(x>1), d); \\ _Michel Marcus_, Jan 27 2025

%Y Cf. A110591, A139352.

%K base,sign

%O 1,4

%A _Clark Kimberling_