Divisors
A number's divisors are everything that divides it evenly, and two simple functions let you count them and add them up straight from the prime factorisation.
What a divisor is
A divisor of a number is anything that divides it cleanly, with nothing left over. The divisors of 12 are 1, 2, 3, 4, 6 and 12. Every number has at least two: 1 and itself. Prime numbers have exactly those two and no more — that is what makes them prime.
Once a number gets big, listing its divisors by hand is slow. The lovely surprise is that you never have to. The prime factorisation — the unique way of writing a number as primes multiplied together — already tells you everything.
Counting them: the function τ
Write a number as its prime factorisation, say n = p^a · q^b · … Then the number of divisors, written τ(n) and read "tau", is just (a+1)(b+1)…
Why the plus-ones? To build a divisor you choose how many copies of each prime to include. For a prime that appears a times you have a+1 choices: zero of it, one of it, up to all a. Multiply the choices together and you have counted every divisor, without writing a single one down.
Adding them up: the function σ
The sum of all the divisors is written σ(n) and read "sigma". It comes from the same factorisation: each prime power p^a contributes the running total 1 + p + p² + … + p^a, which has the tidy closed form (p^(a+1) − 1)/(p − 1). Multiply one such factor per prime and you get σ.
This sum quietly sorts numbers into families. If the divisors below n add up to exactly n, the number is perfect (6 = 1 + 2 + 3). Fall short and it is deficient; overshoot and it is abundant. Perfect numbers are famously rare and precious.
Worked example: 360
Factorise: 360 = 2³ · 3² · 5. For τ, add one to each exponent and multiply: 4 · 3 · 2 = 24. So 360 has 24 divisors — and indeed it does, which is why clocks, circles and dozens love it.
For σ, turn each prime power into its sum. From 2³ you get 1 + 2 + 4 + 8 = 15; from 3² you get 1 + 3 + 9 = 13; from 5 you get 1 + 5 = 6. Multiply: 15 · 13 · 6 = 1170. So the divisors of 360 add up to 1170 — no listing required.