Have questions about Fermat's little theorem? Learn more here!

  • Thread starter Dweirdo
  • Start date
  • Tags
    Theorem
In summary, the conversation discusses using Fermat's little theorem to find pseudo-primes, also known as Carmichael numbers, and addresses the difficulty of dealing with large numbers in the calculation process. It is suggested that by breaking down the number into smaller parts and using simple integer arithmetic, the calculation can be made more manageable.
  • #1
Dweirdo
174
0
Hi, I have spme questions about Fermat's little theorem-http://en.wikipedia.org/wiki/Fermat%27s_little_theorem.

I need to think about a mathematical algorithm to deal with this theorem- finding pseudo-primes ,aka, Carmichael numbers.
When I'm dealing with huge numbers ,it is very difficult,let's say:
a is 5, n is 200
than getting a number like 5^200 is stupid, and thus I need another method which will prevent the calculation of this number.
anybody can point me to the right direction?

another thing that I noticed is, if we do the test for non prime numbers such as 15
then we get pairs of reminders, I mean:
(7^15)%15 =13
(13^15)%15=7
just something cool(it's not just for these numbers! )

Thanks in advance!

DW
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Since 200 = 128 + 64 + 8, all you need is to calculate 5^8 mod 200, 5^64 mod 200, and 5^128 mod 200, and multiply those together ... and it's easy to calculate those because

5^2 mod 200 = ((5 mod 200)*(5 mod 200)) mod 200 = 25

5^4 mod 200 = ((5^2 mod 200)*(5^2 mod 200)) mod 200 = 625 mod 200 = 25

etc.

so you can check each b using simple integer arithmetic in log(n) time.
 
  • #3
cool,
Thank You hamster! :D
 

1. What is Fermat's little theorem?

Fermat's little theorem is a fundamental theorem in number theory, named after the mathematician Pierre de Fermat. It states that if p is a prime number, then for any integer a, a to the power of p minus a is divisible by p.

2. What is the significance of Fermat's little theorem?

Fermat's little theorem is significant because it provides a simple and efficient way to test if a number is prime. It is also used in cryptography to generate and verify digital signatures.

3. How is Fermat's little theorem different from Fermat's last theorem?

While Fermat's little theorem is a proven theorem that applies to prime numbers, Fermat's last theorem is a famous conjecture that remained unproven for over 350 years. It states that there are no positive integer solutions to the equation a^n + b^n = c^n for any integer value of n greater than 2.

4. Can Fermat's little theorem be used to find prime numbers?

Yes, Fermat's little theorem can be used to find prime numbers by repeatedly testing different integers a to see if a^p - a is divisible by p. If it is not divisible, then p is not prime. However, this method is not foolproof and other tests, such as the Miller-Rabin primality test, are more reliable.

5. How is Fermat's little theorem related to Euler's totient function?

Fermat's little theorem is related to Euler's totient function through Euler's theorem, which is a generalization of Fermat's little theorem. Euler's theorem states that if a and n are coprime positive integers, then a^φ(n) is congruent to 1 mod n, where φ(n) is the totient function that counts the number of positive integers less than or equal to n that are coprime to n.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Linear and Abstract Algebra
Replies
7
Views
7K
  • General Math
Replies
1
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
2K
  • General Math
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
546
  • Linear and Abstract Algebra
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Back
Top