Download the TI-83 program |
Given integer values A, E, and M, this program computes A E mod M
: Prompt A
: Prompt E
: Prompt M
: 1->T
: While E >0
: If fPart(E/2)>0
: Then
: T*A-int(T*A/M)*M->T
: End
: A 2 -iPart(A 2 /M)*M->A
: iPart(E/2)->E
: End
: T
The following TI-92 program was written by Anthony Haroules
powermod()
Prgm
Prompt a
Prompt e
Prompt m
1->t
While e>0
If fPart(e/2)>0 Then
t*a-iPart(t*a/m)*m->t
EndIf
a^2-iPart(a^2/m)*m->a
iPart(e/2)->e
EndWhile
Disp t
EndPrgm