Skip to content

Latest commit

 

History

History

092 - Square Digit Chains

Problem 92 / Challenge #92: Square Digit Chains

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$?

ProjectEuler+ Problem Statement

The Project Euler problem is equivalent to the ProjectEuler+ challenge with $K = 7$ and MODULO = False.