I was walking through the desert and came across an ancient contraption of cogs and gears. It had a series of dials on one side that appeared to allow the input and output of numbers. On the other side was an enormous lever. It looked far too old to possibly work, but curiosity got the best of me, so I dialled in the number 1
and pulled the lever. The machine burst to life with a crunch of gears and a cloud of dust. As the dust cleared, I saw the dials slow to a halt leaving it displaying 1
again.
1 => 1
So far, so dull. I tried a few more:
2 => 2
3 => 3
Hmm... Maybe double digits would be more interesting:
82 => 15
47 => 122
Ok, now we're getting somewhere... Never one to be bogged down with the tedium of the scientific method, I dialled in a number at random and pulled the lever multiple times in succession:
58458 => 2433 => 316 => 411 => 112
A sandstorm loomed and I had to abandon the machine to the elements as it was too big to carry. It's likely been swallowed by the sands of the desert once more, but its secrets still haunt my dreams. Help me solve the mystery. What function is the machine applying to transform its input?
Edit (hint 1): I just found my old notebook which I thought was lost in the sandstorm! It has some more sequences that I'd forgotten I'd tried, maybe they'll help you find the solution...
4 => 11
15 => 11
19 => 21
Edit (hint 2): I was lying awake last night thinking of the bizarre contraption and its numbered dials, when I was struck by an epiphany. I sat bolt upright in bed as I made the realisation, shocked that it hadn't dawned on me before, and angry at myself because it seems like such a pivotal observation. Anyway, I recalled that:
None of the dials contained a digit0
, meaning that no number (input or output) could ever have a zero in it... No0
, no50
, no1024
...
Very odd, but hopefully it will help in solving this mystery once and for all...
Apologies... this hint doesn't hold up in all circumstances. I made it a bit too hastily, without thinking it all the way through, as I was attempting to nudge people towards a certain line of thinking.