Page 1 of 1

1,002,023

Posted: October 19th, 2023, 10:23 am
by cinelli
Suppose we write all natural numbers in order in a long line, with no gaps, like

12345678910111213141516171819202122...

What is the 1,002,023rd digit in this list?

Cinelli

Re: 1,002,023

Posted: October 19th, 2023, 12:33 pm
by UncleEbenezer
cinelli wrote:Suppose we write all natural numbers in order in a long line, with no gaps, like

12345678910111213141516171819202122...

What is the 1,002,023rd digit in this list?

Cinelli

Unusual for you. Neither computer nor brainpower required! Though plenty of scope for an off-by-one error below, and I'm not giving myself a headache to be too careful of that :o

The first nine digits are one-digit numbers.
The next 180 digits are 2*90 two-digit numbers.
The next 2700 are 3*900 three-digit numbers.
Etc.

Working with this observation, we can subtract from the left
1002023 - 9 = 1002014
1002014 - 180 = 1001834
1001834 - 2700 = 999134
999134 - 36000 = 963134
963134 - 450000 = 513134

So what we're looking for is the 513134th digit in a concatenation of six-digit numbers.

513134 / 6 = 85522 with remainder 2, so we want the second digit of the 85523rd six-digit number. That number is 185522, so the digit is an 8.

Re: 1,002,023

Posted: October 22nd, 2023, 3:09 pm
by cinelli
Well done UncleEbenezer. You really have produced a model solution which cannot be improved.

Cinelli