Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have two problems which are based on the sequence $A007376$.

  1. Natural numbers starting with $1$ are written one after another like $123456789101112131415\cdots$, how could we find the $10^4$th digit from left?
  2. A hundred digit number is formed by writing the first $x$ natural numbers one after another as $123456789101112131415\cdots$, how to find the remainder when this number is divided by $8$?

The OEIS doesn't provide any formula that could be implemented into a under a minute solution,as this is a quantitative aptitude problem, I was wondering which is the fastest way to approach?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

There are $9$ one-digit numbers, giving the first $9$ digits.

Then there are $90$ two-digit numbers, giving the next $180$ digits; total, $189$ digits, so far.

There are $900$ three-digit numbers, giving $2700$ digits, total $2889$.

To get to $ 10,000$, you need another $7111$, which is $7108/4=1777$ four-digit numbers, and the first $3$ digits of the $1778$th four-digit number. You should be able to figure out what those are.

For the hundred digit number, same process, then remember that the remainder on division by $8$ depends only on the last $3$ digits.

share|improve this answer
    
@MaX Just for the sake of completeness, $12345\cdots545= 12345\cdots\times 100 + 545$ and so $12345\cdots545\mod 8 = (12345\cdots\mod 8)\times (100\mod 8) + (545\mod 8) \mod 8 = 545\mod 8$ since $100\mod 8 = 0\mod 8$. –  Alex Becker Dec 29 '11 at 4:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.