project-euler

Double-base palindromes

Problem Description

The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.

Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.

(Please note that the palindromic number, in either base, may not include leading zeros.)

Performance

Try it online!

Real time: 2.106 s
User time: 1.739 s
Sys. time: 0.229 s
CPU share: 93.45 %
Exit code: 0