Finding the 2021st digit of 123456789101112...

preview_player
Показать описание
If you need to post a picture of your solution or idea:
#CountingProblems #CountingDigits

EXPLORE 😎:

PLAYLISTS 🎵 :

Рекомендации по теме
Комментарии
Автор

You can also work backward by creating a function to express the position p of the first digit of a given number x. For 1-digit numbers, the function is p=x. For 2-digit numbers, it is p=2x-10. Generally, the formula for n digits is Since we know we're dealing with a 3-digit number, the function is p=3x-110. If we solve for p=2021, we get 3x-110=2021 and x=710.333. Taking floor(x) tells us that the number 710 contains the 2021st digit. Substituting 710 back in gives us 3(710)-110=2020, meaning 7 is the 2020th digit, and 1 is the 2021st.

peterromero
Автор

This exact same question was asked in a KVPY (Conducted by Indian Institute of Science) mock test. I had no clue at that time.

ankitbhattacharjee_iitkgp
Автор

The way the blogger solved the task is what I also though to do (it happens not so often), it is just a good analysis.
I also thought that it could be formulated as a programming problem that has a quite simple solution, say in REXX:
s=''; do i=1 by 1 while length(s)<2021; s=s||i; end; say right(left(s, 2021), 1)
The idea is simple to form a string at least 2021 characters long and use (automatic) conversion of numbers to strings. Then truncate the string to length 2021 and take the last character. The result is correct (tested with Regina REXX).

michaelgolub
Автор

It seems to me that it would be a little better to take the ceiling than the floor. If you take the floor, you need to deal with an off-by-one error ([(n-189)/3]+100-1), and the case where the result is a multiple of 3 is a special case -- when we find we want the 0th digit of a number we have to look instead at the final digit of the previous number.

If instead we take the ceiling, we get straight to the number the digit is within instead of the number of complete numbers up to and including the digit: ceil((n-189)/3)+100 is 710, so we're looking for a digit of 710. And we want the first, second, or third digit depending on whether n-189 is 1, 2, or 3 mod 3.

zygoloid
Автор

I am very glad to see that such videos has no dislikes) Math one love

alfreds
Автор

Is there a Mathematical formula that can be used to find any next digit in any place of the number? Like the next digit? The 53rd digit? The 88th digit? The 34th digit?

christopherrice
Автор

Another great explanation, SyberMath!

carloshuertas
Автор

My solution (of course way faster):
First of all I change the problem in order to make it a bit simpler: I'll write all numbers with 3 digits, so I add 1 "0" for every number between 1 and 99 and another "0" for every number between 1 and 9. Since I added 99+9=108 digits, now I'm looking for the 2129th digit.
2129=3.709+2 so I'm looking for the second digit of 710, which is 1.

italixgaming
Автор

This question was given in KVPY 2020. Obviously ...I didn't attempt this question at that time

vaishnavidwivedi
Автор

It seemed impossible to me, but it actually isn't. Amazing!

eliasmazhukin
Автор

Above zero, there are 9 1-digit numbers, 90 2-digit numbers, 900 3-digit numbers, and so on.

joyli
Автор

I was halfway solving this problem, and i was on the right way, but i lost my motivation without any apparent reason 😐
Cool one btw

ahmadmazbouh
Автор

Very interesting, nice video as always.

mirkopacchioni
Автор

nice and fun math. I figured 5 is the 1000, 000th digit.

lmmgt
Автор

Sometimes enumeration is the best approach.

neuralwarp
Автор

Yes, I used essentially the same method.

padraiggluck
Автор

Would also be interesting if 2, 3 and 4 digit numbers also only took 1 space, with other digits added on to the previous spaces. E.g.

10+2=12, 120+3=123, 1230+4=1234... 1234567890+10=1234567900, 12345679000+11=12345679011, 123456790110+12=123456790122 ... and so on. It would be much much more difficult.

ChazCharlie
Автор

How about this - how to find the first index where a string of numbers first occurs?

Avanta
Автор

This was my thought process
9+2×9×
How many double digit numbers?
Well we need 10's 20's 30's... up to 90's so 9 groups
9+2(9)^2+3(9)^3+...
Because the single digits had a count of 9 I thought I was counting groups of 9's instead of 10's 💀

bomboid
Автор

Late premiere, still like u it's 😃😃😃😃

aashsyed