Binary Complement Reverse Sequence

A challenge by mousetail avatar mousetail

Description

The BCR sequence consists of numbers where, if you take the binary complement and reverse it, you get back the original number.

The Sequence on OEIS

10 is one example of a BCR number. When written in binary, 10 becomes 1010. Reverse 1010 to create 0101, and the complement of 0101 is 1010 which is 10 in decimal.

Print all the BCR numbers from 1 to 20,000, each on their own line.

Leaderboard

Author Score
#1 DialFrost avatar DialFrost 57
#2 lukegustafson avatar lukegustafson 59
#3 Bulmenisaurus avatar Bulmenisaurus 62
#3 hallvabo avatar hallvabo 62
#5 4atj avatar 4atj 63
#5 Mukundan314 avatar Mukundan314 63
#5 bizy-coder avatar bizy-coder 63
#8 AlephSquirrel avatar AlephSquirrel 64
#9 ovs-code avatar ovs-code 66
#9 KasperKivimaeki avatar KasperKivimaeki 66
Challenge ends in 23 April 2026
You must be logged in to submit a solution.