ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude

Remainders of large powers: cycles and the (a + 1) and (a - 1) patterns

Find the remainder of a large power from the cycle of remainders of its powers, write the base as a multiple plus or minus 1, and find the remainder of a product of large numbers.

Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.

You will learn to

Before you start

On division by d, a whole number leaves a remainder from 0 up to d - 1. Two facts from earlier remainder work drive this lesson. First, the remainder of a product can be found by swapping each factor for its own remainder, multiplying, and reducing once more. Second, a power is just a repeated product, so the same swap works inside it: on division by 7, 23^n leaves the same remainder as 2^n, because 23 = 21 + 2. A number such as 2^100 has 31 digits, far too many to divide out, so every step below keeps the numbers small. Throughout, the exponent n is a whole number of 1 or more.

Remainders of powers repeat in a cycle

Write down the remainders of the first few powers, reducing after every multiplication. On division by 7, the powers of 2 leave 2, 4 and then 1, and once a remainder of 1 appears the list starts again: 2, 4, 1, 2, 4, 1 and so on. The cycle has length 3, so only the remainder of the exponent on division by 3 matters. For 2^100, 100 = 3 x 33 + 1, so 2^100 leaves the same remainder as 2^1, which is 2. If the exponent is an exact multiple of the cycle length, take the last entry of the cycle. When the base and the divisor share no factor other than 1, a remainder of 1 is bound to turn up, and the cycle length depends on both numbers, so find it by listing. When they do share a factor, 1 never appears and the repeat can start late: on division by 12, the powers of 2 leave 2, 4, 8, 4, 8 and so on, so the cycle 4, 8 begins at the second power. Count the exponent from where the cycle begins: for 2^n with n of 2 or more, use the remainder of n - 2 on division by 2, and 0 gives 4 while 1 gives 8.

Write the base as a multiple plus or minus 1

Some bases sit right beside a multiple of the divisor d. If the base is 1 more than a multiple of d, every power of it leaves remainder 1, since 1 x 1 x 1 and so on stays 1: 50 = 49 + 1, so 50^37 leaves 1 on division by 7. If the base is 1 less than a multiple of d, it acts as -1. An even number of factors of -1 multiply to 1 and an odd number to -1, and a remainder of -1 means d - 1. So, with 48 = 49 - 1, on division by 7 the power 48^20 leaves 1 and 48^21 leaves 6. If the base is not next to a multiple, look for a small power of it that is. On division by 13, 3^3 = 27 = 26 + 1 leaves 1, so 3^50 = (3^3)^16 x 3^2 leaves 1 x 9 = 9.

Products of large numbers and the (a + 1), (a - 1) patterns

For a product of large numbers, find a multiple of the divisor close to each factor and keep only the small gap, which may be negative. On division by 23, the numbers 460 and 690 are multiples, so 461 x 689 acts as 1 x (-1) = -1 and leaves 22. The same thinking gives three patterns for a whole number a of 2 or more, because a is 1 more than a - 1 and 1 less than a + 1. First, a^n - 1 is divisible by a - 1 for every n. Second, a^n - 1 is divisible by a + 1 whenever n is even. Third, a^n + 1 is divisible by a + 1 whenever n is odd, while for even n it leaves remainder 2. For example, 8^15 + 1 is divisible by 9, and 6^30 - 1 is divisible by both 5 and 7.

Common mistakes

Dividing the exponent by 4 out of habit: that cycle belongs to last digits, and each divisor has its own cycle length. Reducing the exponent by the divisor instead of by the cycle length: 100 leaves 2 on division by 7, but 2^100 does not act like 2^2 = 4 on division by 7; it acts like 2^1 and leaves 2. Stopping at a negative answer such as -1 or -9 instead of adding the divisor. Giving remainder 1 for every power of a base that is 1 less than a multiple; with an odd exponent the answer is d - 1. Dropping the leftover factor after splitting the exponent, such as the 3^2 in (3^3)^16 x 3^2. Using the cycle from the first power when the base and divisor share a factor, before checking where the repeat begins.

A remainder routine for powers

1. Replace the base by its remainder, or by a small negative number such as -1 or -2 when that is nearer. 2. If the base now acts as 1, every power leaves 1; if it acts as -1, an even exponent leaves 1 and an odd exponent leaves d - 1. 3. Otherwise list the remainders of its powers until 1 or -1 turns up or the list repeats. 4. Split the exponent into full blocks of that length and a leftover, and multiply the block result by the remainder of the leftover power. If the repeat starts late, first subtract the powers that come before the cycle, then find where the rest of the exponent falls inside it. 5. Bring the answer into the range 0 to d - 1 and, once, test the routine on a power small enough to divide out.

Worked examples

  1. Find the remainder when 5^83 is divided by 11.

    1. List the remainders of the powers of 5 on division by 11, reducing each time: 5, then 25 leaves 3, then 3 x 5 = 15 leaves 4, then 4 x 5 = 20 leaves 9, then 9 x 5 = 45 leaves 1.
    2. Since 5^5 leaves 1, the remainders repeat in a cycle of length 5: 5, 3, 4, 9, 1.
    3. 83 = 5 x 16 + 3, so 5^83 leaves the same remainder as 5^3, the 3rd entry of the cycle.
    4. Check: 5^3 = 125 = 11 x 11 + 4.

    Answer: The remainder is 4.

  2. Find the remainder when 3^95 is divided by 28.

    1. 3^3 = 27 is 1 less than 28, so on division by 28 the power 3^3 acts as -1.
    2. 95 = 3 x 31 + 2, so 3^95 = (3^3)^31 x 3^2.
    3. 31 is odd, so (-1)^31 = -1, and 3^2 = 9. So 3^95 acts as -1 x 9 = -9.
    4. A remainder cannot be negative, so add 28: -9 + 28 = 19.

    Answer: The remainder is 19.

  3. Find the remainder when 699 x 702 x 706 is divided by 7.

    1. 700 = 7 x 100 is a multiple of 7, so measure each factor from 700: 699 = 700 - 1, 702 = 700 + 2 and 706 = 700 + 6.
    2. The factors act as -1, 2 and 6, so the product acts as -1 x 2 x 6 = -12.
    3. Add multiples of 7 until the result lies from 0 to 6: -12 + 14 = 2.
    4. Check: 699 x 702 x 706 = 346,432,788 = 7 x 49,490,398 + 2.

    Answer: The remainder is 2.

Practice checks

  1. What is the remainder when 2^53 is divided by 9?
  2. What is the remainder when 76^45 is divided by 11?
  3. Which of these numbers divides 17^31 + 1 exactly?
  4. What is the remainder when 346 x 351 x 357 is divided by 35?
  5. What is the remainder when 5^47 is divided by 31?

Sources checked