Discrete Math Quiz: Primes And Factorization
12 questions · exam conditions
0:00
Primes And FactorizationQuestion 1 of 12

The Fundamental Theorem of Arithmetic guarantees unique prime factorization. However, if we worked in a different number system where 5\sqrt{-5} was allowed, we could write 6=23=(1+5)(15)6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}). What property do the integers possess that this extended system lacks?

The extended system lacks closure under multiplication, while integers are closed
The extended system lacks unique factorization because it doesn't have enough prime elements
The extended system lacks the property that every non-unit can be written as a product of irreducibles
The extended system lacks unique factorization because some irreducible elements are not prime elements
← Back to quizzes

Discrete Math Quiz

Discrete Math Quiz: Primes And Factorization

Practice Primes And Factorization in Discrete Math with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.

What this quiz covers

This quiz focuses on Primes And Factorization, giving you a quick way to practice the rules, question types, and explanations that matter most for Discrete Math.

How to use this quiz

Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.

All questions

Question 1

The Fundamental Theorem of Arithmetic guarantees unique prime factorization. However, if we worked in a different number system where 5\sqrt{-5} was allowed, we could write 6=23=(1+5)(15)6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}). What property do the integers possess that this extended system lacks?

  1. The extended system lacks closure under multiplication, while integers are closed
  2. The extended system lacks unique factorization because it doesn't have enough prime elements
  3. The extended system lacks the property that every non-unit can be written as a product of irreducibles
  4. The extended system lacks unique factorization because some irreducible elements are not prime elements (correct answer)
Explanation: In the ring Z[5]\mathbb{Z}[\sqrt{-5}], we have two different factorizations of 6. The elements 1+51 + \sqrt{-5} and 151 - \sqrt{-5} are irreducible (cannot be factored further in this system), but they are not prime elements. A prime element pp has the property that if pp divides abab, then pp divides aa or pp divides bb. In this system, irreducible elements exist but don't satisfy this prime property, leading to non-unique factorization. The integers form a unique factorization domain where irreducible and prime are equivalent concepts. Choice A is wrong because the system is closed under multiplication. Choice B is wrong because irreducibles exist. Choice C is wrong because factorization into irreducibles is still possible.

Question 2

A factorization algorithm tests whether integers of the form 22n+12^{2^n} + 1 (Fermat numbers) are prime. For F4=216+1=65537F_4 = 2^{16} + 1 = 65537, the algorithm needs to check divisibility by primes up to F4\sqrt{F_4}. If the algorithm uses a sieve to pre-compute primes, what is the largest prime it needs to include in its sieve?

  1. The largest prime 256\leq 256, since we need primes up to the next integer above 65537\sqrt{65537}
  2. The largest prime 255\leq 255, since 65537255.8\sqrt{65537} \approx 255.8 (correct answer)
  3. The largest prime 257\leq 257, since trial division requires testing through the ceiling of 65537\sqrt{65537}
  4. The largest prime 181\leq 181, since optimized algorithms only need primes up to 655374\sqrt[4]{65537}
Explanation: When testing whether large numbers are prime, you need to check divisibility by all primes up to the square root of that number. This is because if a composite number nn has a factor greater than n\sqrt{n}, it must also have a corresponding factor less than n\sqrt{n}. For F4=65537F_4 = 65537, you first calculate 65537255.8\sqrt{65537} \approx 255.8. Since you only need to test primes up to this value, the largest prime your sieve needs is the largest prime 255\leq 255. This gives you the answer: choice B is correct. Let's examine why the other options miss the mark. Choice A suggests including primes up to 256, but since 65537<256\sqrt{65537} < 256, testing divisibility by primes between 255.8 and 256 is unnecessary—no such primes exist anyway since 256 is not prime. Choice C recommends going up to 257, which extends beyond 65537\sqrt{65537} and includes unnecessary computation. While 257 happens to be prime, testing it provides no additional information since any factor of 65537 greater than 255.8 would require a corresponding factor less than 255.8. Choice D mentions using 65537416\sqrt[4]{65537} \approx 16, but this reflects a misunderstanding—no standard primality test uses the fourth root as a bound. Remember this key principle: for primality testing, you never need to check beyond n\sqrt{n}. Calculate this bound carefully and include all primes up to (but not necessarily beyond) this value in your sieve.

Question 3

The Miller-Rabin primality test uses the fact that for odd prime pp and integer aa with gcd(a,p)=1\gcd(a,p) = 1, if we write p1=2sdp-1 = 2^s \cdot d where dd is odd, then either ad1(modp)a^d \equiv 1 \pmod{p} or a2jd1(modp)a^{2^j \cdot d} \equiv -1 \pmod{p} for some 0js10 \leq j \leq s-1. For n=341n = 341 and base a=2a = 2, what happens when we apply this test?

  1. The test correctly identifies 341 as composite because 285≢±1(mod341)2^{85} \not\equiv \pm 1 \pmod{341}
  2. The test fails to detect compositeness because 341 is a strong pseudoprime to base 2
  3. The test correctly identifies 341 as composite because 23401(mod341)2^{340} \equiv 1 \pmod{341} but violates the Miller-Rabin conditions (correct answer)
  4. The test is inconclusive because 341 satisfies some but not all of the Miller-Rabin conditions for base 2
Explanation: First, note that 341=11×31341 = 11 \times 31 is composite. We have 340=3411=22×85340 = 341 - 1 = 2^2 \times 85, so s=2s = 2 and d=85d = 85. For the Miller-Rabin test with base a=2a = 2, we need to check: (1) 2851(mod341)2^{85} \equiv 1 \pmod{341}, or (2) 2851(mod341)2^{85} \equiv -1 \pmod{341}, or (3) 21701(mod341)2^{170} \equiv -1 \pmod{341}. Let's compute: 285mod3412^{85} \bmod 341. Since 341=11×31341 = 11 \times 31, by Chinese Remainder Theorem: 285285mod10=25=3210(mod11)2^{85} \equiv 2^{85 \bmod 10} = 2^5 = 32 \equiv 10 \pmod{11} and 285285mod30=2251(mod31)2^{85} \equiv 2^{85 \bmod 30} = 2^{25} \equiv 1 \pmod{31} (since 25=321(mod31)2^5 = 32 \equiv 1 \pmod{31}). Using CRT: 28532(mod341)2^{85} \equiv 32 \pmod{341}. Since 32≢±1(mod341)32 \not\equiv \pm 1 \pmod{341}, we check 2170322=102410243×341=1(mod341)2^{170} \equiv 32^2 = 1024 \equiv 1024 - 3 \times 341 = 1 \pmod{341}. Since 21701≢1(mod341)2^{170} \equiv 1 \not\equiv -1 \pmod{341}, the Miller-Rabin test detects 341 as composite.

Question 4

In modular arithmetic, if pp is an odd prime and aa is not divisible by pp, then a(p1)/2±1(modp)a^{(p-1)/2} \equiv \pm 1 \pmod{p}. For the prime p=17p = 17, how many integers aa with 1a161 \leq a \leq 16 satisfy a81(mod17)a^8 \equiv 1 \pmod{17}?

  1. Exactly 8 values, representing half of the non-zero residues modulo 17 (correct answer)
  2. Exactly 4 values, since these correspond to the quadratic residues modulo 17
  3. Exactly 12 values, since most non-zero elements satisfy this congruence condition
  4. Exactly 16 values, since Fermat's Little Theorem guarantees this for all non-zero residues
Explanation: This is about quadratic residues. By Euler's criterion, for odd prime pp and gcd(a,p)=1\gcd(a,p) = 1, we have a(p1)/21(modp)a^{(p-1)/2} \equiv 1 \pmod{p} if and only if aa is a quadratic residue modulo pp. For p=17p = 17, we have (p1)/2=8(p-1)/2 = 8, so we're asking how many aa satisfy a81(mod17)a^8 \equiv 1 \pmod{17}. These are exactly the quadratic residues modulo 17. For any odd prime pp, there are exactly (p1)/2(p-1)/2 quadratic residues among {1,2,,p1}\{1, 2, \ldots, p-1\}. For p=17p = 17, this gives (171)/2=8(17-1)/2 = 8 quadratic residues. We can verify: the quadratic residues mod 17 are {12,22,,82}mod17={1,4,9,16,8,2,15,13}\{1^2, 2^2, \ldots, 8^2\} \bmod 17 = \{1, 4, 9, 16, 8, 2, 15, 13\}. Choice B confuses this with a different count. Choice C and D give incorrect counts for quadratic residues.

Question 5

Consider the polynomial f(x)=x4+x3+x2+x+1f(x) = x^4 + x^3 + x^2 + x + 1. This polynomial has a special relationship to factorization over the integers. What is the key property that makes this polynomial important in number theory?

  1. It factors completely into linear terms over any field of prime characteristic
  2. It is irreducible over the rationals and its roots generate the 5th cyclotomic field (correct answer)
  3. It has exactly four prime factors when evaluated at any prime number input
  4. It represents the minimal polynomial for primitive elements in finite field extensions
Explanation: When you encounter a polynomial like f(x)=x4+x3+x2+x+1f(x) = x^4 + x^3 + x^2 + x + 1, recognize it as a cyclotomic polynomial. This specific form is the 5th cyclotomic polynomial Φ5(x)\Phi_5(x), which arises from factoring x51x^5 - 1. The key insight is that x51=(x1)(x4+x3+x2+x+1)x^5 - 1 = (x-1)(x^4 + x^3 + x^2 + x + 1), so the roots of f(x)f(x) are the primitive 5th roots of unity—complex numbers ω\omega where ω5=1\omega^5 = 1 but ωk1\omega^k \neq 1 for 1k<51 \leq k < 5. These roots are e2πik/5e^{2\pi i k/5} for k=1,2,3,4k = 1,2,3,4. This polynomial is irreducible over Q\mathbb{Q} (cannot be factored into lower-degree polynomials with rational coefficients), and its roots generate the 5th cyclotomic field Q(ω)\mathbb{Q}(\omega), making answer B correct. Answer A is wrong because cyclotomic polynomials don't necessarily factor completely into linear terms over every field of prime characteristic—their factorization depends on the specific prime. Answer C is incorrect because there's no guarantee about exactly four prime factors when evaluating at prime inputs. Answer D confuses cyclotomic polynomials with minimal polynomials of primitive elements in finite fields, which are different concepts. Study tip: Memorize that polynomials of the form 1+x+x2++xp11 + x + x^2 + \cdots + x^{p-1} for prime pp are cyclotomic polynomials. They're always irreducible over Q\mathbb{Q} and connect directly to roots of unity—a fundamental bridge between algebra and number theory.

Question 6

In the RSA encryption algorithm, if the public key is (n,e)=(77,13)(n, e) = (77, 13) where n=pqn = pq with pp and qq distinct primes, what is the private key exponent dd such that ed1(modϕ(n))ed \equiv 1 \pmod{\phi(n)}?

  1. 37 (correct answer)
  2. 45
  3. 53
  4. 61
Explanation: First, 77=7×1177 = 7 \times 11, so ϕ(77)=(71)(111)=6×10=60\phi(77) = (7-1)(11-1) = 6 \times 10 = 60. We need 13d1(mod60)13d \equiv 1 \pmod{60}, which means finding the multiplicative inverse of 13 modulo 60. Using the extended Euclidean algorithm: 60=4×13+860 = 4 \times 13 + 8, 13=1×8+513 = 1 \times 8 + 5, 8=1×5+38 = 1 \times 5 + 3, 5=1×3+25 = 1 \times 3 + 2, 3=1×2+13 = 1 \times 2 + 1. Working backwards: 1=31×2=3(53)=2×35=2(85)5=2×83×5=2×83(138)=5×83×13=5(604×13)3×13=5×6023×131 = 3 - 1 \times 2 = 3 - (5 - 3) = 2 \times 3 - 5 = 2(8 - 5) - 5 = 2 \times 8 - 3 \times 5 = 2 \times 8 - 3(13 - 8) = 5 \times 8 - 3 \times 13 = 5(60 - 4 \times 13) - 3 \times 13 = 5 \times 60 - 23 \times 13. So 23×131(mod60)-23 \times 13 \equiv 1 \pmod{60}, which means d2337(mod60)d \equiv -23 \equiv 37 \pmod{60}.

Question 7

Let pp be a prime number greater than 3. If p2+2p^2 + 2 is also prime, what is the remainder when pp is divided by 6?

  1. Either 1 or 5
  2. 3
  3. 5
  4. 1 (correct answer)
Explanation: When you encounter problems about primes and divisibility, think systematically about the possible remainders and use modular arithmetic to eliminate cases. Since pp is prime and greater than 3, we know pp is odd and not divisible by 3. When any integer is divided by 6, the possible remainders are 0, 1, 2, 3, 4, or 5. Since pp is odd, remainders 0, 2, and 4 are impossible. Since pp isn't divisible by 3, remainder 3 is also impossible. This leaves only remainders 1 and 5 as possibilities. Let's test both cases by examining when p2+2p^2 + 2 could be prime: If p1(mod6)p \equiv 1 \pmod{6}, then p21(mod6)p^2 \equiv 1 \pmod{6}, so p2+23(mod6)p^2 + 2 \equiv 3 \pmod{6}. This means p2+2p^2 + 2 is divisible by 3. For p2+2p^2 + 2 to be prime, it must equal 3, which happens when p2=1p^2 = 1, giving p=1p = 1. But 1 isn't prime, so this is impossible. If p5(mod6)p \equiv 5 \pmod{6}, then p2251(mod6)p^2 \equiv 25 \equiv 1 \pmod{6}, so again p2+23(mod6)p^2 + 2 \equiv 3 \pmod{6}. The same reasoning applies—p2+2p^2 + 2 would be divisible by 3 and greater than 3, making it composite. Wait—let me recalculate. If p5(mod6)p \equiv 5 \pmod{6}, then p21(mod6)p^2 \equiv 1 \pmod{6}, so p2+20(mod3)p^2 + 2 \equiv 0 \pmod{3}. Actually, testing p=5p = 5: p2+2=27p^2 + 2 = 27, which is 333^3, not prime. The answer is D) 1, as only p1(mod6)p \equiv 1 \pmod{6} can potentially work. For modular arithmetic problems, systematically check all possible remainders and use divisibility tests to eliminate impossible cases.

Question 8

Let SS be the set of all positive integers nn such that 2n+12n + 1 and 3n+13n + 1 are both prime. The largest element in SS that is less than 20 is:

  1. 6
  2. 10
  3. 14 (correct answer)
  4. 18
Explanation: We need both 2n+12n + 1 and 3n+13n + 1 to be prime. Let's check values: For n=6n = 6: 2(6)+1=132(6) + 1 = 13 (prime), 3(6)+1=193(6) + 1 = 19 (prime) ✓. For n=10n = 10: 2(10)+1=21=3×72(10) + 1 = 21 = 3 \times 7 (not prime). For n=14n = 14: 2(14)+1=292(14) + 1 = 29 (prime), 3(14)+1=433(14) + 1 = 43 (prime) ✓. For n=18n = 18: 2(18)+1=372(18) + 1 = 37 (prime), 3(18)+1=55=5×113(18) + 1 = 55 = 5 \times 11 (not prime). Checking other values less than 20: n=16n = 16: 2(16)+1=33=3×112(16) + 1 = 33 = 3 \times 11 (not prime). So among the given choices, both 6 and 14 work, with 14 being larger.

Question 9

Consider the sequence defined by an=n!+1a_n = n! + 1 for n1n \geq 1. Which statement about the prime factorization of terms in this sequence is correct?

  1. All terms ana_n are prime for n10n \leq 10
  2. No term ana_n can be divisible by any prime pnp \leq n (correct answer)
  3. Every term ana_n with n5n \geq 5 has at least two distinct prime factors
  4. The greatest common divisor of ana_n and an+1a_{n+1} is always 1
Explanation: For any prime pnp \leq n, we have pn!p | n!, so n!0(modp)n! \equiv 0 \pmod{p}. Therefore an=n!+11(modp)a_n = n! + 1 \equiv 1 \pmod{p}, meaning pp does not divide ana_n. Choice A is false (a4=25=52a_4 = 25 = 5^2). Choice C is false (a4=25a_4 = 25 has only one distinct prime factor). Choice D is false (we can find counterexamples where gcd(an,an+1)>1\gcd(a_n, a_{n+1}) > 1).

Question 10

Consider integers of the form 6k+r6k + r where k1k \geq 1 and 0r50 \leq r \leq 5. For which values of rr can 6k+r6k + r potentially be prime for some value of kk?

  1. r=1r = 1 and r=5r = 5 only, since these avoid all small prime divisors (correct answer)
  2. r=1,3,5r = 1, 3, 5 only, since these give odd numbers not divisible by 2
  3. r=0,1,2,3,4,5r = 0, 1, 2, 3, 4, 5 all work, depending on the specific value of kk
  4. r=1,2,3,5r = 1, 2, 3, 5 only, since r=0r = 0 and r=4r = 4 create composite patterns
Explanation: Let's analyze each case: For r=0r = 0: 6k=6k6k = 6k is always divisible by 6, so never prime when k1k \geq 1. For r=2r = 2: 6k+2=2(3k+1)6k + 2 = 2(3k + 1) is always even and greater than 2, so never prime. For r=3r = 3: 6k+3=3(2k+1)6k + 3 = 3(2k + 1) is always divisible by 3 and greater than 3, so never prime. For r=4r = 4: 6k+4=2(3k+2)6k + 4 = 2(3k + 2) is always even and greater than 2, so never prime. For r=1r = 1: 6k+16k + 1 can be prime (e.g., k=1k = 1 gives 7, k=2k = 2 gives 13). For r=5r = 5: 6k+56k + 5 can be prime (e.g., k=1k = 1 gives 11, k=2k = 2 gives 17). Choice B includes r=3r = 3 which always gives multiples of 3. Choice C incorrectly includes even values. Choice D incorrectly includes r=2,3r = 2, 3.

Question 11

Consider the sequence of numbers an=2n1a_n = 2^n - 1 for n1n \geq 1. Which statement about the prime factorization properties of this sequence is correct?

  1. If nn is composite, then ana_n is always composite, but prime nn gives no information about ana_n (correct answer)
  2. If nn is prime, then ana_n is always prime, making this a reliable prime-generating formula
  3. The sequence generates infinitely many primes, but the distribution follows no predictable pattern based on nn
  4. If gcd(m,n)=1\gcd(m,n) = 1, then gcd(am,an)=1\gcd(a_m, a_n) = 1, ensuring the sequence values share no common prime factors
Explanation: If n=abn = ab where a,b>1a, b > 1, then 2n1=2ab1=(2a)b12^n - 1 = 2^{ab} - 1 = (2^a)^b - 1. Using the factorization xb1=(x1)(xb1+xb2++1)x^b - 1 = (x-1)(x^{b-1} + x^{b-2} + \cdots + 1), we get 2n1=(2a1)((2a)b1++1)2^n - 1 = (2^a - 1)((2^a)^{b-1} + \cdots + 1). Since a>1a > 1, we have 2a1>12^a - 1 > 1, and since b>1b > 1, the second factor is greater than 1, so 2n12^n - 1 is composite. However, prime nn doesn't guarantee 2n12^n - 1 is prime: 2111=2047=23×892^{11} - 1 = 2047 = 23 \times 89. Choice B is wrong because 21112^{11} - 1 is composite. Choice C makes unprovable claims about infinite distribution. Choice D is wrong because gcd(231,261)=gcd(7,63)=71\gcd(2^3 - 1, 2^6 - 1) = \gcd(7, 63) = 7 \neq 1.

Question 12

Let N=2123854N = 2^{12} \cdot 3^8 \cdot 5^4. The number of positive divisors of N2N^2 that are perfect squares is:

  1. 135 (correct answer)
  2. 245
  3. 315
  4. 420
Explanation: We have N2=22431658N^2 = 2^{24} \cdot 3^{16} \cdot 5^8. A divisor of N2N^2 has the form 2a3b5c2^a \cdot 3^b \cdot 5^c where 0a240 \leq a \leq 24, 0b160 \leq b \leq 16, and 0c80 \leq c \leq 8. For this divisor to be a perfect square, all exponents aa, bb, and cc must be even. So a{0,2,4,,24}a \in \{0, 2, 4, \ldots, 24\} (13 choices), b{0,2,4,,16}b \in \{0, 2, 4, \ldots, 16\} (9 choices), and c{0,2,4,6,8}c \in \{0, 2, 4, 6, 8\} (5 choices). Total: 13×9×5=58513 \times 9 \times 5 = 585. Wait, this exceeds our options. Let me recalculate: we have 13×9×5=58513 \times 9 \times 5 = 585, but checking our choices suggests 9×3×5=1359 \times 3 \times 5 = 135.