https://jacoby.github.io/2021/07/27/ugly-and-square-perl-weekly-challenge-123.html