# Project Euler Problem 36: Double-Base Palindromes¶

The source code for this problem can be found here.

## Problem Statement¶

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$$.

Note

that the palindromic number, in either base, may not include leading zeros.

## Solution Discussion¶

This solution simply searches through the integer range and identifies values that are palindromic in bases $$2$$ and $$10$$. These values are summed to produce the answer.

The one clever component is to only consider odd numbers. Every even integer has $$0$$ as its least significant bit which is not allowed for the most significant bit. Therefore no even number is a base $$2$$ palindrome.

## Solution Implementation¶

from lib.digital import is_palindrome

def solve():
""" Compute the answer to Project Euler's problem #36 """
upper_bound = 1000000

solutions.problem36.solve()