EDIT: 1've positioned 1002 nines
(IGNORE THIS)
This one appeared in one of the Russian Olympiads.
Find the final five digits of the number
N = 999...9
that contains 1001 nines positioned as above.
Sorry Rahul, what you have done is not correct. Not all terms of the sum
- ....60000 + ....5000 - ....500 + ....00 - ...1
are correct.
oh sorry. here are the correct ones
...00000 + ...5000 - ...500 + ...10 - ...1 = ...04409
is this correct?
well even that is not correct. think a bit more because you are going in the right direction..
a = 99 = (10-1)9 = 9C0109 +....+ 9C8101(-1)8 - 1
last two digits are 90-1 = 89
so, a = 100p + 89
b = 999 = (10-1)a
last 3 digits are given by -aC2102 + aC110 - aC0
≡ - 100(a-2)(a-1)2 + 10a - 1
≡ - 50(100p+87)(100p+88) + 10(100p+89) - 1
≡ - 600 + 890 - 1 ≡ 289
so b = 1000q+289
c = 9999
similarly proceeding last 4 digits of c are 5289
d = 99999
last 5 digits are 45289
as we increase nines the ending digits remain same as can be observed when we move from a to d
so last 5 digits of 9999.... (1001 nines) are 45289