Project Euler 171 - Square Sum of the Digital Squares

Official link: https://projecteuler.net/problem=171

Thought Process

This problem was essentially Problem 885 + Problem 725, and it uses quite similar logic to Problem 862.

The idea is that if we have a number, n, such that f(n) is a perfect square, any permutation is also a n such that f(n) is a perfect square. For example 244, 424, 4420, 4024, 40024 etc will all work!

This means that we just need to generate all increasing strings (which I covered in Problem 885) and then we need to count the sum of all of them (which I covered in Problem 725)

Explicitly, given an increasing string, n, the sum of all the permutations of length is explained below:

Interactive Code

Input an integer (yourinput)

Code will output the last nine digits of the sum of all n, 0 < n < 10^yourinput, such that f(n) is a perfect square