The set of numbers {9, 99, 999, 9999, ...} has some interesting properties. One of these has to do with factorization. Take any number n that isn't divisible by 2 or by 5. You will be able to find at least one number in the set that is divisible by n. Furthermore, you won't need to look beyond the first n numbers in the set.

Prove it.

(*from http://www.ocf.berkeley.edu/~wwu/riddles/)*

def. N(n) = 10^n - 1 (set)

note the property of differences:

N(n) - N(n') = 10^x * N(n-n') for some x.

example:

N(3) - N(1) = 999-9 = 990 = 10 * N(2) = N(3-1)

consider a certain number p (for the purpose

of divisibility by p) note the remainder to

be 0 for divisibility.

for the elements of the set N(1) .. N(p)

assign for each a remainder r, arising from

N()/p. note that the possible values for

r are only r = 0 to p-1, p different values

in total. the key i think is:

because the property of differences, each N()

must have a different r. since there are p

values of N and p remainders, at least one

of them must be r = 0.

so, there is one N(n) for n ≤ p such

that N(n) is divisible by p