Sunday, October 24, 2010

Modular Arithmetic

Problem Level: 4
Problem Source: AIME

Find the remainder when 9 x 99 x 999... x999 9s is divided by 1000.

Solution:
This series can be expressed as 9x99x999... mod 1000.

The concept of modular arithmetic is very simple.  Mod means the remainder when the whole thing is divided by something. Say 1 mod 5 is 1.
Note that 9 x 99 x (1000-1) x (10000-1)... mod 1000
9 x 99 x -1 mod 1000^97
This so happens to become -891 mod 1000.
Add 1000 to both sides and you get 109.

The AIME (American Invitational Math Exam) Hard Math Problems can be solved through clever manipulations.

2 comments: