Part (a)
Note 999999=1000000-1. By Fermat's little theorem, since 100000=10⁶,
Part (b)
Note that
Since
and
10³ is its own inverse modulo 1001, meaning that:
7.8m questions
10.4m answers