Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Power_mod Calculator

Power_mod

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.

n:890734891069392409315513868057301061;
a:87347707789;
b:120;
b:power_mod(2,b!,n);
p:gcd(b-1,n);
q:n/p;
factor(p-1);
factor(q-1);

          (%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) 

Power_mod Example

Related Examples

mod

mod(24,100);

Calculate

mod

mod(24,8);

Calculate

mod

mod (3, 5);

Calculate

mod

mod(350,7);

Calculate

mod

mod(2013,5);

Calculate

mod

mod (2,3);

Calculate

mod

mod(93^23,187);

Calculate

mod

mod(23^31,299);

Calculate

mod

mod(b*1e18+g*1e13+c*1...

Calculate

mod

(56*x-8*x^1/2-14*x^3/...

int(X/4)+8*int(X/32)-...

14*mod(int(X/4)+8*int...

Calculate