Valhalla Legends Archive

General => General Discussion => Topic started by: Grok on January 03, 2003, 08:20 AM

Title: Base fun
Post by: Grok on January 03, 2003, 08:20 AM
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?
Title: Re: Base fun
Post by: warz on January 03, 2003, 08:24 AM
Interesting, but fun doesn't capture the emotion of this subject.  :P
Title: Re: Base fun
Post by: Skywing on January 03, 2003, 01:30 PM
0x33 == '3' !
Title: Re: Base fun
Post by: Yoni on January 03, 2003, 11:34 PM
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.