Devise a recursive algorithm for finding [tex]x^n \bmod m[/tex] whenever n, x, and m are positive integers, based on the fact that(adsbygoogle = window.adsbygoogle || []).push({});

[tex]x^n \bmod m = (x^{n-1} \bmod m \cdot x \bmod m) \bmod m[/tex]

can anyone give me some hints? i dont know where to start

thank you

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Recursive algorithm

**Physics Forums | Science Articles, Homework Help, Discussion**