All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Triangular Trial (Posted on 2010-07-20)
All the positive triangular numbers are written successively without commas or spaces resulting in this infinite string.

13610152128364555667891105120136153171..............

Determine the 2010th digit in the above pattern.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution Comment 2 of 2 |

DEFDBL A-Z
sought = 2010
FOR i = 1 TO 1000
diff = diff + 1
tr = tr + diff
t\$ = LTRIM\$(STR\$(tr))
PRINT t\$
prevCt = ct
ct = ct + LEN(t\$)
IF ct >= sought THEN
d\$ = MID\$(t\$, sought - prevCt, 1)
PRINT diff; d\$: END
END IF
NEXT

finds as the last couple of lines of its output:

97903
442 3

meaning that the sought digit is 3, being the last digit of the 442nd triangular number, 97903.

 Posted by Charlie on 2010-07-20 13:50:02

 Search: Search body:
Forums (45)