Numbers: formulas & methods

Keep the method clear, then put it into practice.

Use divisibility, prime factorisation and remainders to reason about integers before doing long calculations.

N
Integer being divided.
d
positive integer divisor.
q
Quotient.
r
remainder: N = dq + r, with 0 ≤ r < d.

Division algorithm

N = dq + r; 0 ≤ r < d

d is positive; q and r are integers.

Even and odd

Even = 2k; odd = 2k + 1

k is an integer; odd + odd is even.

Divisibility by 3 or 9

Test the sum of the digits

Divisible by 3 or 9 exactly when the digit sum is.

Divisibility by 4 or 8

Test the last 2 or 3 digits

For 4 use the last two; for 8 the last three.

Count positive divisors

If N = p₁^a₁…pₖ^aₖ, τ(N) = (a₁ + 1)…(aₖ + 1)

Use distinct primes; N > 1. The number 1 has one positive divisor.

Last digit of a power

Reduce the exponent using the last-digit cycle

For exponent ≥ 1; remainder 0 selects the last entry of the cycle.

Explanations and worked examples

Open a method when you need more detail.

Full notation guide
N
Integer being divided.
d
positive integer divisor.
q
Quotient.
r
remainder: N = dq + r, with 0 ≤ r < d.
pᵢ
Distinct primes.
aᵢ
positive integer exponents in a prime factorisation.
τ(N)
Number of positive divisors of the positive integer N.
n
A positive integer count or exponent, as stated.
1. Use the quotient–remainder form

For a positive divisor d, every integer N has a unique integer quotient q and remainder r with 0 ≤ r < d. This restriction matters when interpreting negative dividends.

N = dq + r
Worked example

Find the remainder when −17 is divided by 5 using the nonnegative-remainder convention.

  1. −17 = 5 × (−4) + 3.
  2. The remainder 3 lies between 0 and 4.

3.

Remember

  • Some programming languages use a signed remainder convention; these notes use the mathematical nonnegative remainder.
2. Track parity without calculating everything

Even numbers are multiples of 2. The sum of two odd numbers is even; a product is odd exactly when every factor is odd.

Even ± even = even; odd ± odd = even
Even ± odd = odd
Any even factor makes an integer product even
Worked example

If n is an integer, must n(n + 1) be even?

  1. Two consecutive integers contain one even number.
  2. Their product therefore contains a factor of 2.

Yes, always even.

Remember

  • Zero is even. Checking examples illustrates a rule but does not replace the consecutive-integer argument.
3. Apply digit-based divisibility tests

For 2 or 5, inspect the last digit. For 3 or 9, use the digit sum. For 4 or 8, inspect the last two or three digits. For 11, the alternating digit sum must be a multiple of 11, including zero.

Divisible by 6 ⇔ divisible by both 2 and 3
Divisible by 11 ⇔ alternating digit sum is a multiple of 11
Worked example

Check whether 7,128 is divisible by 9 and by 8.

  1. Digit sum = 7 + 1 + 2 + 8 = 18, divisible by 9.
  2. Last three digits = 128, divisible by 8.

It is divisible by both 9 and 8.

Remember

  • Divisibility by two factors guarantees divisibility by their product only when those factors are coprime. For example, divisibility by 4 and 6 alone does not guarantee divisibility by 24.
4. Factor into primes and recognise squares

A prime is an integer greater than 1 with exactly two positive divisors. Every integer greater than 1 factors uniquely into primes up to order. A perfect square has even prime exponents; a perfect cube has exponents divisible by 3.

Perfect square: every prime exponent is even
Perfect cube: every prime exponent is divisible by 3
Worked example

What is the smallest positive integer multiplier that makes 72 a perfect square?

  1. 72 = 2³ × 3².
  2. Only the exponent of 2 is odd, so multiply by 2.
  3. 72 × 2 = 144 = 12².

2.

Remember

  • The number 1 is neither prime nor composite. Do not confuse a prime factor with an arbitrary divisor.
5. Count divisors from exponent choices

A divisor independently chooses an exponent from 0 through aᵢ for each prime pᵢ. Multiplying the numbers of choices gives the divisor count.

τ(N) = product of (aᵢ + 1)
Worked example

How many positive divisors does 360 have?

  1. 360 = 2³ × 3² × 5¹.
  2. Choices for exponents: 4, 3 and 2.
  3. Number of divisors = 4 × 3 × 2 = 24.

24 positive divisors.

Remember

  • This counts both 1 and N and excludes negative divisors. A perfect square has an odd positive-divisor count.
6. Use last-digit cycles

Multiplication modulo 10 creates repeating last-digit cycles. List a complete cycle before reducing the exponent by its length. A zero exponent is a separate case for a nonzero base.

7¹, 7², 7³, 7⁴ have last digits 7, 9, 3, 1
Worked example

Find the last digit of 7^2026.

  1. The cycle length is 4.
  2. 2026 leaves remainder 2 on division by 4.
  3. Choose the second cycle entry, 9.

9.

Remember

  • If the exponent remainder is 0, use the last cycle entry, not an invented entry zero.
Practise numbers questions