login
Digitally balanced numbers in base i-1: numbers that in base i-1 have the same number of 0's as 1's.
6

%I #9 Mar 21 2021 01:05:20

%S 2,21,26,31,36,41,46,51,310,315,325,330,335,340,345,350,355,360,365,

%T 370,375,390,395,405,410,415,420,425,430,435,455,470,475,485,490,495,

%U 535,550,555,565,570,575,580,585,590,595,600,605,610,620,625,630,635,645

%N Digitally balanced numbers in base i-1: numbers that in base i-1 have the same number of 0's as 1's.

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

%H Walter Penney, <a href="http://dx.doi.org/10.1145/321264.321274">A "binary" system for complex numbers</a>, Journal of the ACM, Vol. 12, No. 2 (1965), pp. 247-248.

%e 2 is a term since its representation in base i-1, 1100, has 2 0's and 2 1's.

%e 21 is a term since its representation in base i-1, 110011010001, has 6 0's and 6 1's.

%t v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}; balQ[n_] := Plus @@ (d = IntegerDigits[n]) == Length[d]/2; q[n_] := balQ @ FromDigits[Flatten@v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; Select[Range[1000], q]

%Y Cf. A066321, A066323, A271472, A342725, A342726, A342728, A342729.

%Y Similar sequences: A031443 (binary), A210619 (Zeckendorf).

%K nonn,base

%O 1,1

%A _Amiram Eldar_, Mar 19 2021