OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Gray Code.
Wikipedia, Gray code.
EXAMPLE
8 is a term since its Gray code, 1100, has 2 0's and 2 1's.
33 is a term since its Gray code, 110001, has 3 0's and 3 1's.
MATHEMATICA
gc[n_] := gc[n] = If[n <= 1, n, 2^(b = Floor@Log2[n]) + gc[2^(b + 1) - 1 - n]]; gcDigBalQ[n_] := Equal @@ DigitCount[gc[n], 2, {0, 1}]; Select[Range[500], gcDigBalQ]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 15 2021
STATUS
approved