% cd your-pc2-directory % /homes/cs390cp/pc2/bin/pc2team &
Log in using your individually assigned “teamX” account and password. You can work in the current window/directory, creating a subdirectory for each problem.
Remember: If you've already solved one or more of these problems, try (1) solving again without referring to your old solution, and/or (2) using a different language (Java or C++). If you want to work on an additional problem from the book, let me know.
Hints:
k
is even, n ^ k mod p
is (n ^ (k/2) mod p) ^ 2 mod p
. Generalize and handle the case for k
odd.(p,e)
pairs for each prime, p
, that divides e
times.p
that divides n!
is n/p + n/p^2 + n/p^3 …
. So, p^e
divides n!
if this sum is at least e
before n/p^k
reaches 0.