# Problems — Level 1: Divisibility, Prime, GCD, LCM

> এই folder-এ Level 1-এর 15টা problem-এর নোট আছে। Level 0-এর মতোই — প্রতিটা problem-এর জন্য আলাদা `.md` file, যেখানে নিজের ভাষায় বোঝা, intuition, dry run, code আর ভুলের হিসাব।

## কীভাবে problem গুলো use করবে?

প্রতিটা note লেখা হয় [../../../templates/math-problem-note-template.md](../../../templates/math-problem-note-template.md) follow করে — ২০টা section-এর template: problem নিজের ভাষায় → brute force → bottleneck → optimization → dry run → complexity → ভবিষ্যতের নিজেকে এক লাইনের চিঠি। এই level-এ template-এর "brute force আগে" নিয়মটা বিশেষ জরুরি — O(n) factor loop আগে লিখে তারপর O(√n)-এ নামলে শেখাটা গাঁথে।

নিয়ম:

1. [../README.md](../README.md)-এর recommended order ধরে এগোও
2. নিজে 20-30 মিনিট চেষ্টা — তারপর concept-notes-এ ফিরে দেখা
3. নিজে সমাধান করার অগ্রগতি আলাদা খাতায় বা tracker-এ রাখো। “নোট আছে” কেবল ব্যাখ্যার উপস্থিতি বোঝায়।

## Tracker table

| # | Problem | Difficulty | Pattern | Inherits from | Source | Note file | নোটের অবস্থা |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 011 | Divisibility Rules | Easy | divisibility | 001 | Classic exercise | [011-divisibility-rules.md](011-divisibility-rules.md) | নোট আছে |
| 012 | Count Factors | Easy | √n factor pairs | 011 | Classic exercise | [012-count-factors.md](012-count-factors.md) | নোট আছে |
| 013 | Check Prime | Easy | trial division | 012 | Classic exercise | [013-check-prime.md](013-check-prime.md) | নোট আছে |
| 014 | Print All Primes up to N | Easy | repeated prime check | 013 | Classic exercise | [014-print-all-primes.md](014-print-all-primes.md) | নোট আছে |
| 015 | Sieve of Eratosthenes | Medium | sieve | 014 | CP-Algorithms — <https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html> (related: LeetCode Count Primes — <https://leetcode.com/problems/count-primes/>) | [015-sieve-of-eratosthenes.md](015-sieve-of-eratosthenes.md) | নোট আছে |
| 016 | Prime Factorization | Medium | peeling primes | 013 | Classic (related: Project Euler 3 — <https://projecteuler.net/problem=3>) | [016-prime-factorization.md](016-prime-factorization.md) | নোট আছে |
| 017 | Smallest Prime Factor | Medium | SPF sieve | 015 | CP-Algorithms sieve variants | [017-smallest-prime-factor.md](017-smallest-prime-factor.md) | নোট আছে |
| 018 | GCD using Euclidean Algorithm | Easy | Euclid | — | CP-Algorithms — <https://cp-algorithms.com/algebra/euclid-algorithm.html> | [018-gcd-euclidean.md](018-gcd-euclidean.md) | নোট আছে |
| 019 | Extended GCD Intro | Hard | back-substitution | 018 | CP-Algorithms — <https://cp-algorithms.com/algebra/extended-euclid-algorithm.html> | [019-extended-gcd-intro.md](019-extended-gcd-intro.md) | নোট আছে |
| 020 | LCM using GCD | Easy | lcm = a*b/gcd | 018 | Classic (related: Project Euler 5 — <https://projecteuler.net/problem=5>) | [020-lcm-using-gcd.md](020-lcm-using-gcd.md) | নোট আছে |
| 021 | Coprime Check | Easy | gcd = 1 | 018 | Classic exercise | [021-coprime-check.md](021-coprime-check.md) | নোট আছে |
| 022 | Count Coprime Pairs Basic | Medium | gcd over pairs | 021 | Classic exercise | [022-count-coprime-pairs.md](022-count-coprime-pairs.md) | নোট আছে |
| 023 | Euler Phi Basic | Medium | totient formula | 016, 021 | CP-Algorithms — <https://cp-algorithms.com/algebra/phi-function.html> | [023-euler-phi-basic.md](023-euler-phi-basic.md) | নোট আছে |
| 024 | Number of Divisors | Medium | exponent formula | 016 | CSES Counting Divisors — <https://cses.fi/problemset/task/1713> | [024-number-of-divisors.md](024-number-of-divisors.md) | নোট আছে |
| 025 | Sum of Divisors | Medium | exponent formula | 024 | Classic (harder variant: CSES Sum of Divisors — <https://cses.fi/problemset/task/1082>) | [025-sum-of-divisors.md](025-sum-of-divisors.md) | নোট আছে |

## Problem-দের পারিবারিক গাছ

```
001 (parity, Level 0)
   └─> 011 (divisibility) ─> 012 (count factors) ─> 013 (prime check)
                                                       ├─> 014 (all primes) ─> 015 (sieve) ─> 017 (SPF)
                                                       └─> 016 (factorization) ─> 023, 024 ─> 025

018 (Euclid GCD) ─┬─> 019 (extended gcd — Hard, Level 2-র সেতু)
                  ├─> 020 (lcm)
                  └─> 021 (coprime) ─> 022 (coprime pairs) ─> 023 (phi)
```

আটকে গেলে "Inherits from" ধরে এক ধাপ পেছনে যাও — উত্তরের সূত্র প্রায়ই সেখানেই।

## একটা ছোট পরামর্শ

এই level-এ অনেক problem-এর দুটো সমাধান থাকবে: একটা সরল (loop-all), একটা চালাক (√n / sieve / formula)। **দুটোই লেখো।** সরলটা দিয়ে চালাকটার উত্তর verify করা — এই অভ্যাসটা contest আর interview দুই জায়গাতেই বাঁচাবে। আর 019 (Extended GCD) নিয়ে এখন perfection-এর দরকার নেই — Level 2-তে modular inverse করার সময় ওটা আবার সামনে আসবে, তখন আরও অর্থবহ লাগবে।

Concept ঝালাই → [../concept-notes.md](../concept-notes.md)। ছবি → [../visualization-ideas.md](../visualization-ideas.md)।
