Brainteaser 1712: Squambling
From The Sunday Times, 9th July 1995 [link]
In “squambling” a number, the first (leftmost) digit is squared, the next is cubed, the next raised to the fourth power, and so on. The total of these answers provides a new number, ready for the squambling to begin again.
For example:
18 → 1² + 8³ = 513 → 5² + 1³ + 3⁴ = 107
107 → 2402 → 100 → 1 → 1 → …If you take my age and squamble it you get a three-figure number. If you then squamble that answer you get my age next year.
How old am I?
This puzzle is included in the book Brainteasers (2002). The puzzle text above is taken from the book.
[teaser1712]
Jim Randell 8:38 am on 15 September 2019 Permalink |
This Python program runs in 86ms.
Run: [ @replit ]
from enigma import (nsplit, irange, inf, printf) squamble = lambda n: sum(d ** n for (n, d) in enumerate(nsplit(n), start=2)) assert squamble(18) == 513 for n in irange(1, inf): sn = squamble(n) if not (99 < sn < 1000): continue s2n = squamble(sn) if not (s2n == n + 1): continue # output solution printf("{n} -> {sn} -> {s2n}") breakSolution: You are 46.
We have:
After 91 applications of the function we eventually reach a value of 43, which is stable (i.e. squamble(43) = 43).
The next smallest value at which this occurs is 753:
LikeLike