Project Euler 340 - Crazy Functions

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