Ad
  • Default User Avatar

    Yup, thanks, I've just done that :) I wanted to leave a note here for the time being, in case someone reads this solution and wonders whether it's correct. I realised too late that other solutions have similar problems.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Note that this solution is not correct, as it pretty much assumes that Euler's theorem holds true when base and mod are not coprime. For instance, this code claims that tower( 6, 2, 8 ) = 4, whereas the correct answer would be 0.