Question 23
Shawn starts with a positive integer $n$. Repeatedly subtract the largest perfect square not exceeding the current number until reaching $0$. For example, $60\to11\to2\to1\to0$. Let $N$ be the smallest starting value whose sequence contains eight numbers, counting the start and $0$. Find the sum of the digits of $N$.