Solving the Fermat Test for 513: Is it Prime?

  • Thread starter Thread starter Fairy111
  • Start date Start date
  • Tags Tags
    Prime Test
Click For Summary
The discussion focuses on using the Fermat test to determine if 513 is a prime number. The user selects 'a' as 8 and needs to compute 8^512 mod 513. They express confusion about the exponentiation process and how to apply modular arithmetic effectively. The conversation emphasizes the compatibility of squaring with modulo calculations, suggesting a step-by-step approach to simplify the computation. Ultimately, the goal is to demonstrate that 513 is not prime if 8^512 is not congruent to 1 mod 513.
Fairy111
Messages
72
Reaction score
0

Homework Statement


Use the Fermat test to show that 513 is not a prime number.



Homework Equations





The Attempt at a Solution



What i have so far is:

n=513
Then i pick an 'a' with 1<a<n
Let a=8

So i need to compute a^(n-1) mod n
-> 8^512 mod 513

If 8^512 is not congruent to 1 mod 513, then i have shown 513 is not a prime number.

However i am stuck with how to do this.

Any help would be great thanks!
 
Physics news on Phys.org
It might help to note that 512 = 2^9, so
8^512 = 8^(2^9) = (...(((8^2)^2)^2)...)^2)
 
Im still struggling with this question.

I don't follow the part,

=(...(((8^2)^2)^2)...)^2)
 
I mean, for example, that

(82)2 = 84
(the square of the square is the fourth power),
((82)2)2 = (84)2) = 88,
and so on.

Also, the operation of squaring is "compatible" with modulo calculus, in the sense that
84 (mod x) = (82)2 (mod x) = ((82 (mod x))2 (mod x).
So when you want the modulus of the fourth power, which is the modulus of the square of the square, you can first square once, take the modulus, then square again, and take the modulus (check it, for example take x = 3). You can apply this to find, for example, 8512 (mod 123) without first calculating 8512 (which no common calculator can do).

Does this make sense, so far?
 
Question: A clock's minute hand has length 4 and its hour hand has length 3. What is the distance between the tips at the moment when it is increasing most rapidly?(Putnam Exam Question) Answer: Making assumption that both the hands moves at constant angular velocities, the answer is ## \sqrt{7} .## But don't you think this assumption is somewhat doubtful and wrong?

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
Replies
4
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
16
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K