login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A344345
Digitally balanced numbers in Gray code: numbers whose binary reflected Gray code has the same number of 0's as 1's.
1
3, 8, 12, 14, 33, 35, 39, 47, 49, 51, 55, 57, 59, 61, 130, 132, 134, 136, 140, 142, 144, 152, 156, 158, 160, 176, 184, 188, 190, 194, 196, 198, 200, 204, 206, 208, 216, 220, 222, 226, 228, 230, 232, 236, 238, 242, 244, 246, 250, 517, 521, 523, 525, 529, 531, 535
OFFSET
1,1
LINKS
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
Similar sequences: A031443 (binary), A210619 (Zeckendorf), A342727 (base i-1).
Sequence in context: A161517 A255199 A280239 * A310284 A296368 A183991
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 15 2021
STATUS
approved