3
$\begingroup$

How to find the, say, 28383rd term of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2,.... ?

EDIT: The sequence is the sequence of digits of positive integers in order.

thanks,

  • 0
    I assume the sequence consists of the digits of the sequence of all positive integers in order? In any case, you should clarify this.2011-09-04
  • 0
    Yes, you got it right. I'm sorry if I missed any detail.:)2011-09-04
  • 0
    @yati sagade, Please take a look at this thread: http://math.stackexchange.com/questions/626216/find-the-n-rm-th-digit-in-the-sequence-123456789101112-dots2014-01-03

3 Answers 3

0

There is a formula that can be used to compute this based on the sum:

$$g(n)=\sum_{1\leqslant k \leqslant n} 9 \times 10^{k-1} \times k = \frac{ 9(n+1)10^n-10^{n+1}+1} {9} \qquad k,n \in \mathbb{Z^+}$$

Plug it in to:

$$ p=10^{\lceil a \rceil} -1 - \left\lfloor \frac{g( \lceil a \rceil) - g(a)}{\lceil a \rceil} \right\rfloor, g(a) = n \qquad a \in \mathbb{R^+}$$

And now find $r$

$$r = g(\lceil a \rceil ) - g(a) \mod \lceil a \rceil $$ The $r$ gives you the index of the $n$th digit in the number $p$.

and get the digit from: $$p = (a_r\dots a_1a_0)$$

Read more here: Find the $n^{\rm th}$ digit in the sequence $123456789101112\dots$

4

Just to complement Ross Millikan's answer, notice that using digits of your sequence as decimal fractional digits produces a number, known as Champernowne constant.

For verification purposes you could use Mathematica:

In[130]:= RealDigits[ChampernowneNumber[], 10, 1, -28383]

Out[130]= {{3}, -28382}
  • 0
    That is interesting, Sasha.2011-09-04
2

Hint: think about how many terms are produced by the 1 digit numbers, then how many terms are produced by the 2 digit numbers, etc. That will allow you to get that you are in the $m$ digit numbers and the end of the $m-1$ digit numbers is $p$. So now you want the $28383-p$ term of the $m$ digit numbers, and each one contributes $m$ terms.

  • 0
    great. here's what I can corroborate(tell me If I go wrong) - 9 terms from 1-digiters, 180 from 2-digiters, 1800 from 3 digiters, 18000 from 4 digiters. That leaves 8394 terms to go, all from 5 digiters. Is it the 4th digit of 9999 + 1679? pardon me if I was stupid.2011-09-04
  • 0
    Why $180$ for 2-digits? You should start counting at $10$ and stop at $99$, which should give you $90$ numbers. Similarly you get $900$ numbers with $3$ digits, $9000$ for $4$ digits and in general $9\cdot 10^{k-1}$ for $k$ digits.2011-09-04
  • 0
    ...unless you meant to count the digits, in which case $90\cdot2 = 180$ is correct, but $900\cdot3 = 2700$ etc.2011-09-04
  • 0
    Yes that's what I meant, since the terms in this sequence are digits. What next? was I right till the last part?2011-09-04
  • 0
    @yati sagade: So the one through three digit numbers give 9+180+2700=2889 digits, leaving 25494. 6373 [=floor(25494/4)] four digit numbers (ending in 7372) give 25492 more, so we want the second digit of 7373, which is 3.2011-09-04
  • 0
    Enlightenment! Learned a new thing today. Thanks a lot! :)2011-09-04