Square my chunks and add
The idea is to transform the integer a into b and iterate. Cut a into the number of chunks you want, square them, add those squares. Example a = 1023 can be transformed in b (last column) like this: 1 ² + 0 ² + 2 ² + 3 ² = 1 + 0 + 4 + 9 = 14 = b 1 ² + 0 ² + 23 ² = 1 + 0 + 529 = 530 10 ² + 2 ² + 3 ² = 100 + 4 + 9 = 113 10 ² + 23 ² = 100 + 529 = 629 102 ² + 3 ² = 10404 + 9 = 10413 1023 ² = 1046529 Question #1 Starting with 2 and iterating, what is the shortest path ending in 1? Here are 11 steps (left column) – can you do better? 2 –> 2² = 4 4 –> 4² = 16 16 –> 1² + 6² = 1 + 36 = 37 37 –> 37² = 1369 1369 –> 1² + 3² + 6² + 9² = 1 + 9 + 36 + 81 = 127 127 –> 12² + 7² = 144 + 49 = 193 193 –> 1² + 9² + 3² = 1 + 81 + 9 = 91 91 –> 9² + 1² = 82 82 –> 8² + 2² = 64 + 4 = 68 68 –> 6² + 8² = 36 + 64 = 100 100 –> 1² + 0² + 0² = 1 1 END Question #2 What is the sho