Fermat's Test for Prime Numbers and Pseudo Primes: Explained

  • Context: Undergrad 
  • Thread starter Thread starter MathematicalPhysicist
  • Start date Start date
  • Tags Tags
    Test
Click For Summary

Discussion Overview

The discussion centers on Fermat's test for prime numbers and the concept of pseudoprime numbers. Participants explore the implications of Fermat's test, specifically how to identify pseudoprime numbers without checking an infinite number of bases.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions how to find pseudoprime numbers without checking every integer base a, given that there are infinitely many.
  • Another participant states that the equivalence of Fermat's test can be expressed in modular arithmetic, suggesting that only values of a less than p need to be checked.
  • Several participants engage in a technical discussion about the properties of modular arithmetic and how they relate to Fermat's test.
  • There is a clarification that the theorem allows results from smaller values of a to extend to larger integers.
  • One participant expresses confusion about the implications of the modular arithmetic discussion and how it leads to the conclusion regarding the range of a.

Areas of Agreement / Disagreement

The discussion contains multiple viewpoints regarding the application of Fermat's test and the identification of pseudoprime numbers. Participants do not reach a consensus on the clarity of the modular arithmetic explanation or its implications for checking values of a.

Contextual Notes

Some participants express uncertainty about the mathematical reasoning presented, particularly regarding the necessity of checking values of a less than p and the implications of modular arithmetic in this context.

MathematicalPhysicist
Science Advisor
Gold Member
Messages
4,662
Reaction score
372
i read the book "the man who loved only numbers" by paul hoffman, and there is explanation about fermat's test for checking prime numbers which states: if n is prime then for every whole number a the number a^n-a is a multiple of n.
now my question is about a pseduo prime number which "fools" this test how could you find such a number, i mean you should check every a which is ofcourse infinite numbers how could you possibly know that n is pseduo prime number by not checking every a?

btw the smallest p.p number is 561.
 
Physics news on Phys.org
The statement

ap[/size] - a is a multiple of p

is equivalent to

ap[/size] = a (modulo p)


So, by the virtue of modulo arithmetic, we only need to check values of a that are less than p.

There are probably much more efficient theoretical tests for pseudoprimes, but my number theory book is at work so I can't look them up.
 
Originally posted by Hurkyl



So, by the virtue of modulo arithmetic, we only need to check values of a that are less than p.

why is it that?
 
I'll presume it's obvious that px = 0 mod p.


Consider this:

(a+kp)b = ab + kpb = ab (mod p)

Letting b = (a+kp)i, you can prove by induction that

(a+kp)n = an for all n.
 
Originally posted by Hurkyl
I'll presume it's obvious that px = 0 mod p.


Consider this:

(a+kp)b = ab + kpb = ab (mod p)

Letting b = (a+kp)i, you can prove by induction that

(a+kp)n = an for all n.
x is integer?
 
Originally posted by Hurkyl


(a+kp)n = an for all n.
excuse my ignorance but how does this proove you only need to check values of a smaller than p?
 
Because

ap[/size] = a (mod p)

iff

(a+kp)p[/size] = a+kp (mod p)


P.S. all those little p's are supposed to be exponents.
 
still don't get it )-: how does it prooves a+kp<p?


sorry to bother you.
 
It doesn't.

Once we've checked all values of a less than p, this theorem extends our results to any other value of a because any integer n can be written as m + pk for some integer m in [0, p).
 

Similar threads

  • · Replies 36 ·
2
Replies
36
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 21 ·
Replies
21
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K