Let x = 0.123456789101112...997998999, where the digits are obtained by writing the integers1 through 999 in order. Find the 1983rd digit to the right of the decimal point.
Printable View
Let x = 0.123456789101112...997998999, where the digits are obtained by writing the integers1 through 999 in order. Find the 1983rd digit to the right of the decimal point.
7
Code:'VB6
sub FindIt()
dim text as string
dim i as long
text = "0."
for i = 1 to 999
text = text & str(i)
next i
msgbox mid$(text, 1985,1)
End Sub
Code:Main> last (take 1983 (foldr1 (++) (map show [1..999])))
'7'