Home > Software > Brain teaser: digits

Brain teaser: digits


I heard an interesting, even though easy, problem in the brain teaser category.
The digits of the numbers between 1 and 1999 are concatenated together in this order to create a new number. What is the 1999 digit of this number?
After you solve it, remember that this is for a 5th grade kid😀.

Categories: Software Tags:
  1. October 6, 2010 at 12:07 am

    ! Spoiler alert !

    Sure, a 5th grade kid would solve it right away if he knew Python🙂
    In : ”.join([str(i) for i in range(1,2000)])[1999 – 1] #0-indexed
    Out: ‘7’

    Anyway, manual method, could probably be solved easier:

    First 9 numbers have 1 digit. – 1990 digits left
    10-99 – 90 numbers have 2 digits – 1810 digits left
    100-999 – 900 numbers have 3 digits but we only need 1810 digits -> 1810/3 = 603.33 -> the answer is the fist digit of the 603rd number in this category -> 703 -> 7

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: