Project Euler #188: The hyperexponentiation of a number

  • + 0 comments

    https://github.com/retiman/project-euler/blob/bef367b700d350272707b728a99a69f83bb2eb99/strategies/problem-00188.txt

    Is this going into the right direction? What can you do if gcd(a, m) > 1

    I tried using phi(m) in all cases, but I get incorrect results (as expected), but not reducing the size of the exponent, even if I do so, only when gcd > 1, still gets me timeouts.

    Note: I already stop the recusion if m = 1;