Project Euler 156 - Counting Digits

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

Thought Process

Putting the first few numbers in OEIS lands you https://oeis.org/A094798 which in turn gives you the OEIS sequence for the fixed points in this sequence: https://oeis.org/A014778 which lead me to the following paper: https://arxiv.org/abs/2305.10357 

The paper shows how to solve this problem and many variants of it. 

Section 7 details an algorithm on how to efficiently compute f(n, d) and then how to efficiently find all the fixed points! 

The paper itself is an interesting read, and it is not very hard to understand why the algorithm works, so I will not explain it here since the authors have already done a great job! I provide my code with comments based on the paper.

Interactive Code

Input an integer (yourinput)

Code will output all numbers n such that n = f(n, yourinput)