• Practice
  • About 14 min
  • 5 practice questions

Numbers from a range: multiples, primes, squares and digits

Count numbers with a property in a range such as 1 to 50 or the two-digit numbers, handling overlaps with the LCM, and find the probability.

If something looks wrong, please tell us.

A very common exam question picks a number at random from a range, such as 1 to 50, and asks for the chance that it has some property. These are counting questions in disguise: count the numbers with the property, and divide by the size of the range. The work is in counting multiples, primes, squares and digit patterns without error, especially when two properties overlap.

Counting tools

  • Multiples of k up to N: the whole part of N ÷ k.
  • Multiples of a or b: count(a) + count(b) − count(LCM of a and b).
  • Squares up to N: the whole part of √N; cubes: the whole part of the cube root of N.
  • Primes up to 40 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 (12 of them); up to 30 there are 10.

Worked example 1: multiples of 3 or 7

A number is chosen at random from 1 to 50. What is the probability that it is a multiple of 3 or 7? Multiples of 3: 50 ÷ 3 gives 16. Multiples of 7: 50 ÷ 7 gives 7. Multiples of 21 (both): 50 ÷ 21 gives 2, namely 21 and 42. The count of numbers that are multiples of 3 or 7 is 16 + 7 − 2 = 21. The probability is 21/50.

Worked example 2: squares or cubes

A number is chosen at random from 1 to 100. What is the probability that it is a perfect square or a perfect cube? Perfect squares: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, which is 10 numbers. Perfect cubes: 1, 8, 27, 64, which is 4 numbers. Numbers on both lists: 1 and 64, since they are both squares and cubes, which is 2. Total = 10 + 4 − 2 = 12. The probability is 12/100 = 3/25.

When two properties can overlap, count each, then subtract the numbers that have both.

— Rule to remember

Two-digit numbers

There are 90 two-digit numbers (10 to 99). To find the probability that a randomly chosen one has digit sum 9, list them: 18, 27, 36, 45, 54, 63, 72, 81, 90, which is 9 numbers. The probability is 9/90 = 1/10. For numbers divisible by 6: the smallest is 12 and the largest 96, and (96 − 12) ÷ 6 + 1 = 15 numbers, so the probability is 15/90 = 1/6.

Worked example 3: multiples of 4 or 6

A number is chosen from 1 to 60. What is the probability that it is a multiple of 4 or 6? Multiples of 4: 15. Multiples of 6: 10. Multiples of both are multiples of the LCM 12: 5. The count is 15 + 10 − 5 = 20, so the probability is 20/60 = 1/3. Note that the LCM is 12, not 24, which would be the product.

A primes check

From 1 to 40, the primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 and 37, which is 12 numbers. P(prime) = 12/40 = 3/10. From 1 to 30, there are 10 primes, so the probability of a prime is 10/30 = 1/3. The number 1 is not prime, so never include it.

Key takeaways

  • Use the whole part of N ÷ k to count multiples.
  • For 'or', subtract the overlap, which is counted by the LCM.
  • Squares and cubes overlap at sixth powers: 1 and 64 up to 100.
  • Count carefully the total size of the range; two-digit numbers are 90, not 100.

Check your understanding

  1. 1. A number is chosen at random from 1 to 50. What is the probability that it is a multiple of 3 or 7?

    1. 21/50
    2. 23/50
    3. 19/50
    4. 16/50
    Show answer

    Answer: A. 16 multiples of 3 + 7 multiples of 7 − 2 multiples of 21 = 21. P = 21/50.

  2. 2. A number is chosen at random from 1 to 100. What is the probability that it is a perfect square or a perfect cube?

    1. 7/50
    2. 1/10
    3. 3/25
    4. 7/100
    Show answer

    Answer: C. 10 squares + 4 cubes − 2 numbers on both lists (1 and 64) = 12. P = 12/100 = 3/25.

  3. 3. A two-digit number is chosen at random. What is the probability that the sum of its digits is 9?

    1. 1/9
    2. 1/8
    3. 1/12
    4. 1/10
    Show answer

    Answer: D. The numbers are 18, 27, 36, 45, 54, 63, 72, 81 and 90, so 9 of the 90 two-digit numbers. P = 1/10.

  4. 4. A number is chosen at random from 1 to 60. What is the probability that it is a multiple of 4 or 6?

    1. 2/5
    2. 1/2
    3. 1/3
    4. 1/4
    Show answer

    Answer: C. Multiples of 4: 15. Multiples of 6: 10. Multiples of 12: 5. Total = 15 + 10 − 5 = 20, so P = 20/60 = 1/3.

  5. 5. A number is chosen at random from 1 to 40. What is the probability that it is a prime number?

    1. 3/10
    2. 1/4
    3. 7/20
    4. 1/3
    Show answer

    Answer: A. The 12 primes up to 40 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 and 37. P = 12/40 = 3/10.

Privacy · Terms · Refunds · Delivery