∑ZWMath CoursesSyllabusExercises
ES
ZWMath›Elementary number theory›Primes and cryptography›Fermat primality test›ZW-FERMAT-PRIMALITY-TEST-008
Course menu
AreaNumber theoryCourseElementary number theoryTopicPrimes and cryptography
Divisibility and factorization10
  • Bézout's identity
  • Extended Euclidean algorithm
  • Euclid's lemma
  • Fundamental theorem of arithmetic
  • Least common multiple
  • Infinitude of primes
  • Linear Diophantine equation
  • Greatest common divisor Discrete mathematics
  • Euclidean algorithm Discrete mathematics
  • Prime number Discrete mathematics
Congruences9
  • Complete residue system
  • Modular inverse
  • Linear congruence
  • Chinese remainder theorem
  • Fermat's little theorem
  • Euler's totient function
  • Euler's theorem
  • Wilson's theorem
  • Modular congruence Discrete mathematics
Orders and quadratic residues6
  • Multiplicative order
  • Primitive root
  • Quadratic residue
  • Legendre symbol
  • Euler's criterion
  • Law of quadratic reciprocity
Arithmetic functions5
  • Multiplicative arithmetic function
  • Divisor functions
  • Perfect number
  • Möbius function
  • Möbius inversion formula
Continued fractions and Diophantine equations4
  • Continued fraction
  • Convergent of a continued fraction
  • Pell's equation
  • Sum of two squares
Primes and cryptography3
  • RSA cryptosystem
  • Fermat primality test
  • Prime number theorem

Exercise · ZW-FERMAT-PRIMALITY-TEST-008 · ★★☆ Intermediate

For n = 13 and a = 5, what is the remainder of \( 5^{12} \bmod 13 \)?

Choose one option.

Show answer
  • B. 1

← Back to the question

Explanation

By Fermat's little theorem, \( 5^{12} \equiv 1 \pmod{13} \), since 13 is prime and gcd(5, 13) = 1.

Study Elementary number theory in ZWMath →

Review the concept: Fermat primality test

The Fermat primality test is a probabilistic criterion for an integer \(n>1\): it declares \(n\) composite if, for some base \(a\) coprime to \(n\), the power \(a^{n-1}\) is not congruent to 1 modulo \(n\).

\[a^{n-1} \equiv 1 \pmod{n}\]

More practice problems: fermat primality test

  • ZW-FERMAT-PRIMALITY-TEST-001 What does a^n-1 not≡ 1 pmodn with gcd(a, n) = 1 tell you?
  • ZW-FERMAT-PRIMALITY-TEST-002 What is 2^4 bmod 15 ?
  • ZW-FERMAT-PRIMALITY-TEST-003 What is the name of the test that uses a^n-1 ≡ 1 pmodn to detect composites?
  • ZW-FERMAT-PRIMALITY-TEST-004 What condition must the base a satisfy in the Fermat test?
  • ZW-FERMAT-PRIMALITY-TEST-005 If n is prime and gcd(a, n) = 1, what holds?
  • ZW-FERMAT-PRIMALITY-TEST-006 Compute 3^6 bmod 7 and state whether the test with base 3 concludes that 7 is prime or composite.
  • ZW-FERMAT-PRIMALITY-TEST-007 Use the test with base 2 for n = 9. What do you conclude?
  • ZW-FERMAT-PRIMALITY-TEST-009 For n = 21 and a = 2, what result does the Fermat test give?

← ZW-FERMAT-PRIMALITY-TEST-007 ZW-FERMAT-PRIMALITY-TEST-009 →

Practice

⏱Exam simulator10 random questions with a grade☰All exercises
◉Open on course✦Open on free study↗Open on the map

ZWMath · Math from definition to practice. Open the interactive map · Syllabus · All exercises

Author: ORCID iD 0009-0009-8641-3511

Privacy · About Speedrunz · Contact