Study and Productivity

Prime, Perfect, Armstrong and More: A Guide to Special Number Properties

Learn the tests for prime, perfect, abundant, Armstrong, triangular, Fibonacci, Harshad and happy numbers, with examples and a way to scan for them.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
Prime, Perfect, Armstrong and More: A Guide to Special Number Properties

Prime, Perfect, Armstrong and More: A Guide to Special Number Properties

Whole numbers have personalities. Some have no divisors except 1 and themselves, some equal the sum of their own divisors, some can be arranged as triangles. Questions about these properties turn up in school worksheets, maths olympiad warm-ups and programming exercises. This guide explains how to test for each property by hand. The number properties explorer runs all the tests at once and shows the reasoning for any of them.

Start with the prime factorisation

Almost every property flows from writing the number as a product of primes. Divide by 2 as often as you can, then 3, then 5, 7, 11 and so on. You only need to try primes up to the square root: if none divides the number, what is left is prime.

360 = 2³ × 3² × 5.

Counting divisors

Each divisor chooses how many of each prime to take: 0 to 3 twos, 0 to 2 threes, 0 or 1 five. That gives (3 + 1)(2 + 1)(1 + 1) = 24 divisors. You never have to list them to count them.

Summing divisors

Multiply the sums of the powers of each prime: (1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 15 × 13 × 6 = 1,170.

Perfect, abundant and deficient

Subtract the number from its divisor sum to get the sum of its proper divisors.

  • Equal to the number: perfect. 28 → 1 + 2 + 4 + 7 + 14 = 28.
  • Larger: abundant. 12 → 1 + 2 + 3 + 4 + 6 = 16.
  • Smaller: deficient. Every prime is deficient, since its only proper divisor is 1.

Perfect numbers are rare: 6, 28, 496 and 8128 are the only ones below ten thousand. Most abundant numbers are even; the first odd one is 945.

Squares, cubes and triangles

A number is a perfect square when every index in its prime factorisation is even, and a perfect cube when every index is a multiple of 3. 144 = 2⁴ × 3² is a square; 216 = 2³ × 3³ is a cube.

Triangular numbers (1, 3, 6, 10, 15, …) count the dots in a triangle, n(n + 1) ÷ 2. The test is neat: n is triangular exactly when 8n + 1 is a perfect square. For 55, 8 × 55 + 1 = 441 = 21², so 55 is triangular.

Fibonacci numbers

You could generate the sequence until you pass your number, but there is a shortcut known as Gessel's test: n is a Fibonacci number exactly when 5n² + 4 or 5n² − 4 is a perfect square. For 21, 5 × 441 − 4 = 2201, not a square, but 5 × 441 + 4 = 2209 = 47², so 21 is Fibonacci.

Digit-based properties

These depend on writing the number in base 10.

  • Palindrome: reads the same backwards, like 12321.
  • Armstrong (narcissistic): equals the sum of its digits each raised to the number of digits. 153 = 1³ + 5³ + 3³ and 9474 = 9⁴ + 4⁴ + 7⁴ + 4⁴.
  • Harshad (Niven): divisible by its digit sum. 18 has digit sum 9 and 18 ÷ 9 = 2.
  • Happy: repeatedly replace the number by the sum of the squares of its digits; happy numbers reach 1. 19 → 82 → 68 → 100 → 1.
  • Digital root: keep adding digits until one is left, or use 1 + ((n − 1) mod 9).

Scanning a range

Some of the best questions combine properties: which primes below 1,000 are palindromes? Which numbers are both square and triangular? In the explorer's range scanner, set the limits, add the properties and it lists every match; tap a number to see its full profile. Square and triangular gives 1, 36 and 1225 below 10,000.

Exercises to try

  1. How many divisors does 720 have? (Hint: 720 = 2⁴ × 3² × 5.)
  2. Is 945 abundant?
  3. Find all three-digit Armstrong numbers.
  4. Is 89 a Fibonacci number? Use Gessel's test.

Check your answers in the explorer: (1) 30, (2) yes, its proper divisors add up to 975, (3) 153, 370, 371 and 407, (4) yes.

Limits

The tests in this guide and in the explorer are for positive whole numbers written in base 10; digit properties change in other bases. The explorer handles numbers up to one trillion and scans at most 200,000 numbers at a time, so it is a study and puzzle aid rather than a tool for research into very large numbers.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages