Post Reply 
Triangular number AND sum of first m factorials
01-10-2018, 04:03 AM
Post: #7
RE: Triangular number AND sum of first m factorials
Tn&Sf:

« { } 3 ROT
FOR n n Sfac 8 * 1 + ISPF? { √ 1 - 2 / + n I→R + } { DROP } IFTE
NEXT
»

Sfac:

« DUP 1 - 2
FOR m 1 + m * -1
STEP 1 +
»

ISPF?

« 1
»

7 Tn&Sf ->

{ '(√73-1)/2' 3. '(√265-1)/2' 4. 17 5. '(√6985-1)/2' 6. '(√47305-1)/2' 7. }



49G or 50g in exact mode

ISPF? (IsPerfectSquare?) has yet to be implemented. It should return 1 when the argument is a perfect square and 0 otherwise. Then the output would be a list of n and m pairs, separated by dots. Just in case someone wants to try.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Triangular number AND sum of first m factorials - Gerson W. Barbosa - 01-10-2018 04:03 AM



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