6. Control questions and tasks / Контрольні запитання і завдання
Divisibility, primes, GCD/LCM
- Define b∣a (“b divides a”). When is an integer even? How
does the parity follow from nmod2?
- Define a prime number. Why is it enough to test divisors only up to
n when checking primality?
- State the identity the Euclidean algorithm is based on. Use it to compute
gcd(48,18), showing each step.
- State the relation between gcd(a,b) and lcm(a,b). Use it to
find lcm(15,20).
Factorization and totient
- State the Fundamental Theorem of Arithmetic. Give the prime factorization
of 56.
- Define Euler’s totient φ(n). Write the product formula in terms of
the distinct prime factors of n, and use it to compute φ(12).
- Which integers in {1,…,12} are counted by φ(12)? List them.
Methods of proof
- Describe the structure of a direct proof of a statement “if P then Q”.
Give a direct proof that if n is even then 2∣n.
- State the principle of mathematical induction (base case and inductive
step). What is the induction hypothesis?
- Prove by induction that the sum of the first n odd numbers equals n2.
- Why does verifying a statement for many specific inputs not constitute a
proof, whereas an induction argument does?
Functions and complexity
- What are the domain and range of a function? Give the domain and range
of f(x)=x2+2x+1, and evaluate f(3).
- State the time complexity of
isPrime, gcd, and totient, and justify each
in one sentence.
Tasks by hand
- Compute gcd(84,30) and then lcm(84,30).
- Give the prime factorization of 360 and use it to compute φ(360).
Laboratory/Laboratory5/6questions.md · 1.9 KB · updated 2026-07-31 21:14