• Welcome to Valhalla Legends Archive.
 

Base fun

Started by Grok, January 03, 2003, 08:20 AM

Previous topic - Next topic

Grok

I ran across a number today that got me thinking ...

What number(s) in hex look the same in decimal if you ignore the last digit?

0x224E08 comes pretty close, being 2248200 decimal.

What formula would you use to represent all such pairs?

warz

#1
Interesting, but fun doesn't capture the emotion of this subject.  :P

Skywing


Yoni

#3
Mathematically,
sum(i=0,m)(a(i)16^i) = sum(j=1,n)(b(j)10^j)
Sounds like you'd have to solve an annoying exponential equation. Would be easier to check all the numbers from 0 to 0xffffffff (or whatever limit), perhaps after adding some rules (such as "don't check numbers that have digits A-F in their hex representation") to simplify the search.