Very first test successful. Let's go for refactoring and clean up before coding second test.
Trying to factorize code...
Code factorized. Still need to translate 4, 9, 40, ...
Working solution...