Solving the Fermat Test for 513: Is it Prime?

  • Thread starter Fairy111
  • Start date
  • Tags
    Prime Test
In summary, the Fermat test was used to show that 513 is not a prime number. The process involved picking a value for 'a' and computing a^(n-1) mod n. By noting that 512 = 2^9, it was determined that 8^512 = (...(((8^2)^2)^2)...)^2). This process can be applied to find the modulus of higher powers, such as 8512 (mod 123).
  • #1
Fairy111
73
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
  • #2
It might help to note that 512 = 2^9, so
8^512 = 8^(2^9) = (...(((8^2)^2)^2)...)^2)
 
  • #3
Im still struggling with this question.

I don't follow the part,

=(...(((8^2)^2)^2)...)^2)
 
  • #4
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?
 

1. What is the Fermat Test for determining primality?

The Fermat Test is a probabilistic algorithm used to determine if a given number is prime or composite. It is based on Fermat's Little Theorem which states that if a number, n, is prime, then for any integer a, a^(n-1) ≡ 1 (mod n).

2. How does the Fermat Test work?

The Fermat Test works by choosing a random integer, a, between 1 and n-1 and calculating a^(n-1) mod n. If the result is equal to 1, then the number is likely prime. However, if the result is not equal to 1, then the number is definitely composite.

3. Why is the Fermat Test not a definitive test for primality?

The Fermat Test is not a definitive test for primality because there are rare cases where composite numbers can pass the test. These numbers are called pseudoprimes. Additionally, the test can produce false positives for composite numbers with small factors.

4. How does the Fermat Test for 513 determine if the number is prime or composite?

The Fermat Test for 513 works by choosing a random integer, a, between 1 and 512 and calculating a^512 mod 513. If the result is equal to 1, then 513 is likely prime. However, if the result is not equal to 1, then 513 is definitely composite.

5. Are there other tests besides the Fermat Test that can determine the primality of a number?

Yes, there are other tests like the Miller-Rabin Test and the Solovay-Strassen Test that can determine the primality of a number. These tests are more efficient and accurate than the Fermat Test, but they also have limitations.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
949
  • Calculus and Beyond Homework Help
Replies
16
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
538
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
16
Views
2K
Replies
1
Views
750
  • Calculus and Beyond Homework Help
Replies
1
Views
5K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
Back
Top