Notes on Computer Lab 2
Here are two useful tricks to keep in mind when using Maple. The
point is to have to type, and retype, things as rarely as possible.
This makes your interactions with Maple easier, faster, and less prone
to error.
- If you ever think you're going to use a number more than once,
store it in a variable.
- The symbol % always refers to the output of the last
calculation.
So, one way of doing problem 6.9.1 might have been:
> n := 712446816787;
n := 712446816787
> e := 6551;
e := 6551
> c := 273095689186;
c := 273095689186
> ifactor( n );
(962099) (740513)
> p := 962099; q := 740513;
p := 962099
q := 740513
> phin := (p-1)*(q-1); # could also have used the built-in phi(n);
phin := 712445114176
> d := e^(-1) mod phin;
d := 368022327335
> c&^d mod n;
151405
> num2text(%);
"one"