Divisibility & Primes

Learn divisibility rules, factors, multiples, prime numbers, and the Sieve of Eratosthenes.

44 lessons
137 min
Codeforces: 900-1300LeetCode: 1300-1600

Lessons

1. Intro

(The Goal)

2m

2. What is Divisibility

(When division leaves no remainder)

3m

3. Factors and Multiples

(Two sides of divisibility)

3m

4. Divisibility Rule - 2

(Last digit even)

3m

5. Divisibility Rule - 5

(Last digit 0 or 5)

3m

6. Divisibility Rule - 10

(Last digit 0)

2m

7. Divisibility Rule - 3

(Sum of digits divisible by 3)

3m

8. Divisibility Rule - 9

(Sum of digits divisible by 9)

3m

9. Divisibility Rule - 4

(Last two digits divisible by 4)

4m

10. Prime Numbers

(Only two factors)

4m

11. Composite Numbers

(More than two factors)

3m

12. Prime Factorization

(Breaking down into primes)

4m

13. Fundamental Theorem of Arithmetic

(Unique prime factorization)

4m

14. Finding All Divisors

(Check up to square root)

4m

15. Finding Divisors - Implementation

(Loop to square root)

4m

16. Testing for Primality

(Check divisors up to square root)

3m

17. Quiz: Divisibility Rules

(Knowledge check)

2m1 problems

18. The Sieve of Eratosthenes

(Ancient algorithm for primes)

4m

19. Sieve Example

(Finding primes up to 30)

4m

20. Sieve - Implementation

(Boolean array approach)

5m

21. Sieve Optimization

(Start at p squared)

3m

22. Problem - Count Primes

(Entry problem)

2m1 problems

23. Count Primes - Insight

(Use the sieve)

3m

24. Count Primes - Algorithm

(Sieve then count)

3m

25. Count Primes - Pseudocode

(Implementation ready)

3m1 problems

26. Problem - Ugly Number

(Prime factors check)

2m1 problems

27. Ugly Number - Insight

(Divide out allowed primes)

3m

28. Ugly Number - Algorithm

(Divide and check remainder)

3m

29. Ugly Number - Pseudocode

(Implementation ready)

2m1 problems

30. Problem - Perfect Number

(Sum of proper divisors)

2m1 problems

31. Perfect Number - Insight

(Find divisors efficiently)

3m

32. Perfect Number - Algorithm

(Sum proper divisors)

3m

33. Perfect Number - Pseudocode

(Implementation ready)

3m1 problems

34. Quiz: Prime Numbers

(Knowledge check)

2m1 problems

35. Greatest Common Divisor

(Largest shared factor)

4m

36. Least Common Multiple

(Smallest shared multiple)

3m

37. Applications of Divisibility

(Where these concepts appear)

4m

38. How Many Primes Exist

(Infinitely many)

4m

39. Coprime Numbers

(GCD equals 1)

3m

40. Problem - Largest Prime Factor

Find the biggest prime

2m1 problems

41. Largest Prime Factor - Insight

The key observation

4m

42. Largest Prime Factor - Algorithm

Step by step approach

3m

43. Largest Prime Factor - Implementation

The pseudocode

4m1 problems

44. Section Recap

What we learned

2m

Ready to start learning?

Access all 44 lessons with interactive content and progress tracking.