1. Divisibility Rules
| Divisor | Rule |
|---|
| 2 | Last digit is even (0, 2, 4, 6, 8) |
| 3 | Sum of digits divisible by 3 |
| 4 | Last 2 digits divisible by 4 |
| 5 | Last digit is 0 or 5 |
| 6 | Divisible by both 2 and 3 |
| 8 | Last 3 digits divisible by 8 |
| 9 | Sum of digits divisible by 9 |
| 10 | Last digit is 0 |
| 11 | (Sum of odd-place digits) − (sum of even-place digits) is 0 or a multiple of 11 |
| 7 | Drop last digit d, take rest + 5d; repeat |
| 13 | Drop last digit d, take rest + 4d; repeat |
| 17 | Drop last digit d, take rest − 5d; repeat |
| 19 | Drop last digit d, take rest + 2d; repeat |
2. HCF & LCM
For two numbers, HCF×LCM=a×b, so LCM=HCFa×b and HCF=LCMa×b.
Fractions: HCF=LCM of denominatorsHCF of numerators and LCM=HCF of denominatorsLCM of numerators.
3. Prime Factorisation & Factors
If N=paqbrc with p,q,r prime:
- Total factors: d(N)=(a+1)(b+1)(c+1)
- Sum of factors: σ(N)=p−1pa+1−1⋅q−1qb+1−1⋅r−1rc+1−1
- Product of factors: Nd(N)/2
- Distinct prime factors: count the distinct primes (e.g. 23⋅32⋅5⇒3)
- Odd factors: ignore the power of 2, then (aodd+1)(bodd+1)⋯
- Even factors: total factors − odd factors
4. Factorials
N!=N(N−1)(N−2)⋯2⋅1, with 0!=1!=1.
- Trailing zeros in N!: Z=⌊5N⌋+⌊25N⌋+⌊125N⌋+⋯
- Highest power of prime p in N! (Legendre): ⌊pN⌋+⌊p2N⌋+⌊p3N⌋+⋯
5. Remainder & Divisibility Theorems
- an−bn is always divisible by a−b.
- an+bn is divisible by a+b only when n is odd.
- an−bn is divisible by a+b only when n is even.
- Fermat: if p is prime and gcd(a,p)=1, then ap−1≡1(modp).
- Wilson: if p is prime, (p−1)!≡−1(modp).
6. Unit Digit (Cyclicity)
Only unit digits matter in a product — e.g. 37×48×29⇒7×8×9=504⇒ unit digit 4.
| Last digit | Cycle | Length |
|---|
| 0, 1, 5, 6 | itself | 1 |
| 4 | 4, 6 | 2 |
| 9 | 9, 1 | 2 |
| 2 | 2, 4, 8, 6 | 4 |
| 3 | 3, 9, 7, 1 | 4 |
| 7 | 7, 9, 3, 1 | 4 |
| 8 | 8, 4, 2, 6 | 4 |
Use nmod2 for length-2 digits and nmod4 for length-4 (if the remainder is 0, use the last value in the cycle).
7. Number of Digits
Digits in N: ⌊log10N⌋+1. Digits in Nk: ⌊klog10N⌋+1.
8. Base Conversion
- Decimal → base b: repeated division by b (read remainders bottom-up).
- Base b → decimal: (anan−1…a0)b=anbn+an−1bn−1+⋯+a0.
9. Handy Properties
- gcd(n,n+1)=1 · gcd(2n,2n+2)=2
- n(n+1) is always even.
- n(n+1)(n+2) is always divisible by 6.
- n(n+1)(n+2)(n+3) is always divisible by 24.