0

How can I find the answer of this type of modular exponentiation? Here, one thing should be noticed, that is 'MOD' value may or may not be prime. I need a generalized formula/method. Similar type question was asked before but there was solution under various condition. I didn't find my answer.

$$ (a^{b^{c^{{d^\ddots}^z}}})\bmod M\ =\ ?\ [\ 1\leq (a,b,c,....z,M) \leq 10^{16}\ ]$$

  • What has been tried ? –  Mar 31 '19 at 15:09
  • Just do Euler's Theorem combined with Chinese Remainder theorem as many times as you need. You seldom need to go very far. – fleablood Mar 31 '19 at 15:19
  • I really don't know what "(a^b^c^d^...^z)%MOD = ? 1<= (a,b,c,....z,MOD)<= 10^16" is supposed to be asking. If "<=" means less than or equal I don't know what you are assuming about an order on modular equivalence (which don't have intrinsic order). – fleablood Mar 31 '19 at 15:21
  • @fleablood sir, Would you please elaborate ? – Kazi Ziaul Hassan Mar 31 '19 at 15:28
  • 1
    You first. What ARE you asking???? But to solve $a^{b^{c^d}} \pmod n$. Solve $(\gcd(a,n))^{b^{c^d}} \equiv 0 \pmod \gcd(a,n)$. Let $a'=\frac a{\gcd(a,n)}$ and $n'=\frac n{\gcd(a,n)}$ and solve $a'^{(b% \phi(n'))^{c^d}}\pmod n'$. Etc. – fleablood Mar 31 '19 at 15:39
  • 1
    is it supposed to be a parenthesized power tower ? It won't affect the method, but may affect the answer out of it. –  Mar 31 '19 at 16:08

0 Answers0