Something like Champernowne constant

On the blackboard, my friend Arbi writes the number 1, 2, 3, and so on. What is the 1 millionth digit that he writes?

Note : Arbi writes so that 12345678910111213141516 and so on. So the 10th digit that he writes is '1', not '10'.

6 9 4 1 8 5 3 2

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

The following table show the total number of digits n n for i t h i^{th} term ( a i = i a_i = i ) for i = 9 , 99 , 999... i = 9, 99, 999... , that is before the number of digits k k of i i increases by 1 1 :

k i 9 k × 1 0 k n 1 9 9 9 2 99 180 189 3 999 2700 2889 4 9999 36000 38889 5 99999 450000 488889 6 999999 5400000 5888889 7 9999999 63000000 68888889 8 99999999 720000000 788888889 9 999999999 8100000000 8888888889 \begin{array} {rrrr} k & i & 9k\times 10^k & n \\ 1 & 9 & 9 & 9 \\ 2 & 99 & 180 & 189 \\ 3 & 999 & 2700 & 2889 \\ 4 & 9999 & 36000 & 38889 \\ 5 & 99999 & 450000 & 488889 \\ 6 & 999999 & 5400000 & 5888889 \\ 7 & 9999999 & 63000000 & 68888889 \\ 8 & 99999999 & 720000000 & 788888889 \\ 9 & 999999999 & 8100000000 & 8888888889 \end{array}

From the table, we can tell that for n = 1000000 n = 1000000 , 99999 < i < 999999 99999 < i < 999999 and that:

i = 99999 + 1000000 488889 6 = 99999 + 511111 6 i = 99999 + \left\lceil \dfrac {1000000-488889}{6} \right\rceil = 99999 + \left\lceil \dfrac {511111}{6} \right\rceil

= 99999 + 85185.16667 = 99999 + 85186 = 185185 \quad = 99999 + \left\lceil 85185.16667 \right\rceil = 99999 + 85186 = 185185

Let us check what is the n i 1 n_{i-1} of the last digit of i 1 = 185184 i-1 = 185184 :

n i 1 = 488889 + 6 × 85185 = 999999 n_{i-1} = 488889+6\times 85185 = 999999

Therefore, for n = 1000000 n = 1000000 or the 100000 0 t h 1000000^{th} digit of the sequence is the first digit of 185185 185185 which is 1 \boxed{1} .

Brock Brown
Feb 3, 2015

Python:

1
2
3
4
5
6
next_digit = 1
board = ''
while len(board) < 1000000:
    board = board + str(next_digit)
    next_digit += 1
print "Answer:", board[999999]

Programmers solve it Like a Boss!!

Samad Badi - 6 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...