Online Algebra Calculator
Many of users do not use powerful Maxima computer algebra system for systematic work, but for ad hoc algebraic calculations – equations, functions, matrixes, etc. only. To do this job, it is not useful to download the whole application from a web site.
Function: power_mod (<a>, <n>, <m>) Uses a modular algorithm to compute a^n mod m where <a> and <n> are integers and <m> is a positive integer. If <n> is negative, inv_mod is used to find the modular inverse.

(%i1) power_mod(3, 15, 5);
(%o1) 2
(%i2) mod(3^15,5);
(%o2) 2
(%i3) power_mod(2, -1, 5);
(%o3) 3
(%i4) inv_mod(2,5);
(%o4) 3(%o1) true (%i2)