### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

13 December 2011

Posted by on **From New Scientist #2794, 8th January 2011** [link]

My godson is 5 years old. When you work out his age raised to a power equal to itself you get 5

^{5}= 3125, which ends with his age.Similarly, if you take my age in years and raise it to a power equal to itself then the answer ends with my age. And if you reverse the two different digits of my age and work out my “reverse age” raised to a power equal to itself then the answer ends with my reverse age.

I was also surprised to find that, if you raise my reverse age to a power equal to my age then the answer also ends with my reverse age.

Clearly I do not expect you to work out any of these powers, as they all consist of over 100 digits! However, you should still be able to answer the question: how old am I?

[enigma1628]

Advertisements

%d bloggers like this:

Python has bignum support, so it’s not a problem to deal with full powers involved. The program runs in 29ms.

Solution:You are 57.My pocket calculator can cope with (the first eight digits of) 56^57 and 57^56 but throws in the sponge at 57^57. That’s a good indication, I think, that 57 is the lowest integer which when raised to its own power is greater than 1E100. It turns out to be a very good starting point.

57^4 mod 100 = 1. 56 being a multiple of 4, 57^56 mod 100 also equals 1.

Multiply by an extra 57 and you get a number ending in 57.

All odd powers of 75 end in 75. So 57 was a lucky guess.

Hi Hugh,

If you install Python 3, you can use the interactive shell as calculator, without writing any code:

>>> 57 ** 57

12158129736671364080886280192352136280305445908985401876990335800107686586023081377754367704855688057

>>> 75 ** 75

426181657761258833198605424151960757395791315610122269092300199179088043392834051588896184557263865748388820264835885609500110149383544921875

>>> 75 ** 57

75594815832868199776770376005214530088120923458388982924968264582969712517268590090679936110973358154296875

Here is another Python 3 solution: