Prob­lem

Some pos­i­tive inte­gers n have the prop­erty that the sum [ n + reverse(n) ] con­sists entirely of odd (dec­i­mal) dig­its. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such num­ber­sre­versible; so 36, 63, 409, and 904 are reversible. Lead­ing zeroes are not allowed in either n or reverse(n).

There are 120 reversible num­bers below one-thousand.

How many reversible num­bers are there below one-billion (109)? 

Solu­tion

The solu­tion I have posted here solves the prob­lem but it takes a good 15 mins or so to run so doesn’t meet the 1 minute rule.. unfor­tu­nately brute force is the only way I know how to solve this problem :-(

Share

Leave a Reply