Post Reply 
TI-60: Triangle Numbers
12-16-2018, 03:35 AM
Post: #1
TI-60: Triangle Numbers
Here I exploit TI-60's RST function's ability to continue program execution and using the square root function as a "tester" to calculate triangle numbers.

Instructions:

1. In RUN mode (outside of LRN), store the following values:

R0 = 0
R1 = n

2. Execute the program by pressing [RST], [R/S]. The program is done when you see "Error".

3. Clear the error by pressing [CE/C].

4. Recall R0. This is your triangle number. (R1 will have -1).

TI-60 Program: Triangle Numbers
Code:

PC00  OP71:  RCL 
PC01  OP01:  1
PC02  OP61:  STO 
PC03  OP85:  +
PC04  OP00:  0     // sum R1 in R0
PC05  OP75:  -
PC06  OP01:  1
PC07  OP95:  =
PC08  OP61:  STO
PC09  OP01:  1    // store R1 -1 in R1
PC10  OP86:  √  // take the square root of R1, if R1<0, the error occurs, ending the "loop"
PC11  OP22:  RST  // reset back to step 00

Link to blog post: https://edspi31415.blogspot.com/2018/12/...mbers.html
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
TI-60: Triangle Numbers - Eddie W. Shore - 12-16-2018 03:35 AM
RE: TI-60: Triangle Numbers - Dieter - 12-16-2018, 05:33 PM
RE: TI-60: Triangle Numbers - grsbanks - 12-16-2018, 07:08 PM
RE: TI-60: Triangle Numbers - Thomas Klemm - 12-16-2018, 09:56 PM
RE: TI-60: Triangle Numbers - ijabbott - 12-17-2018, 02:55 PM
RE: TI-60: Triangle Numbers - Thomas Klemm - 12-19-2018, 04:23 AM



User(s) browsing this thread: 1 Guest(s)