CIS 3362 Homework #5 Solution
Number Theory, RSA
Due: Wednesday, 11/10/2010
1)
Determine the following values:
a) Φ(235) = Φ(5 x 47) = (5 – 1)(47 – 1) = 184
b) Φ(5045) = Φ(5 x 1009) = (5 – 1)(1009 – 1) = 4032
c) Φ(6034176)= Φ(2
8
x 3
5
x 97) = (2
8
– 2
7
)(3
5
– 3
4
)(97 – 1) = 1990656
d) Φ(646000000) = Φ(2
7
x 5
6
x 17 x 19) = (2
7
– 2
6
)(5
6
– 5
5
)(17 – 1)(19 – 1) = 230400000
e) Φ(55898489) = Φ(7129 x 7841) = (7129 – 1)(7841 – 1) = 55883520
Note: A calculator was used to prime factorize (a) through (d), but the program below was used
to prime factorize (e):
#include <stdio.h>
int main() {
int val = 55898489; // Hard-coded for problem 1e.
int div = 2;
while (div <= val) {
// Found a divisor, print and go on.
if (val%div == 0) {
printf("%d\n", div);
val /= div;
}
else
div++;
}
return 0;
}
2)
Without the aid of any computing device, show how one can use Euler's Theorem to
determine the remainder when 53
2378
is divided by 259.
Φ(259) = Φ(7 x 37) = (7 – 1)(37 – 1) = 216.
Thus, according to Euler’s theorem, 53
216
≡ 1 mod 259.
53
2378
= 53
2376
53
2
= (53
216
)
11
53
2
≡ 1
11
(2809) ≡ 219 mod 258
3)
A primitive root, α, of a prime, p, is a value such that when you calculate the remainders of
α,
α
2
, α
3
, α
4
, .
.. , α
p-1
, when divided by p, each number from the set {1, 2, 3, .
.., p-1} shows up
exactly once. In fact, one can simply check if α is a primitive root by calculating these
remainders and seeing the first exponent that produces a remainder of 1. If p-1 is that exponent,
then α is a primitive root. Write a short program that prompts the user to enter a prime number,
p, and then tells the user each primitive root in the set {1, 2, 3, .
.., p-1}. You are guaranteed that