Telling which number is where in decimal expansion

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
Benn
Messages
34
Reaction score
0
I have the number .1212212221222212222122222122222221222222221222222222... (notice that the number of 2s increase by one each time)...

Is there a way to come up with an equation that would tell you the number that's in the nth digit?
 
Mathematics news on Phys.org
The "1"s occur in positions 1,3,6,10,15,... These are the triangular numbers n(n+1)/2 for non-negative integer n. So you want to see if the m-th position is a "1", just solve n2+n-2m = 0 and see if there are integer solutions. If not the answer is a "2".