OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Walter Penney, A "binary" system for complex numbers, Journal of the ACM, Vol. 12, No. 2 (1965), pp. 247-248.
EXAMPLE
2 is a term since its representation in base i-1, 1100, has 2 0's and 2 1's.
21 is a term since its representation in base i-1, 110011010001, has 6 0's and 6 1's.
MATHEMATICA
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]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Mar 19 2021
STATUS
approved