P92
projecteuler.net

Square Digit Chains

ℹ️Published on Friday, 1st April 2005, 06:00 pm; Solved by 45231;
Difficulty rating: 5%

A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before.

For example, \begin{align} &44 \to 32 \to 13 \to 10 \to \mathbf 1 \to \mathbf 1\\ &85 \to \mathbf{89} \to 145 \to 42 \to 20 \to 4 \to 16 \to 37 \to 58 \to \mathbf{89} \end{align}

Therefore any chain that arrives at $1$ or $89$ will become stuck in an endless loop. What is most amazing is that EVERY starting number will eventually arrive at $1$ or $89$.

How many starting numbers below ten million will arrive at $89$?



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.