Question 768603
The remainders are always 5 short of the divisor.
For example, if the number, {{{N}}} is divided by 15, the remainder is {{{10}}}, so that for some integer {{{p}}},
{{{N=15p+10}}}-->{{{N+5=15p+15=15(p+1)}}},
which makes {{{N+5}}} a multiple of {{{15}}}.
The same happens with 18, 21, 24, and 27.
That number, {{{N}}}, is such that {{{N+5}}} is a multiple of 15, 18, 21, 24, and 27.
That means {{{N+5}}} is a multiple of the least common multiple of
{{{15=3*5}}},
{{{18=3*2*3=2*3^2}}},
{{{21=3*7}}},
{{{24=3*2^3}}}, and
{{{27=3^3}}},
and that least common multiple is
{{{2^3*3^3*5*7=7560}}}
Dividing 1,000,000 by 7560 we find a quotient of 132 plus a remainder of 2080.
That means that {{{132*7560+2080=1000000}}}-->{{{132*7560=1000000-2080=997920}}}
and 997,920 is a multiple of 7560.
The next multiple of 7560 is {{{133*7560=1005480}}}
That means that {{{997920}}} is the largest {{{N+5}}} multiple of 15, 18, 21, 24, and 27 that will yield a number {{{N}}} with 6 digits,
So {{{N+5=997920}}} --> {{{highlight(N=997915)}}}.