Post Reply 
(49G & 38G & Prime) OEIS A111138: No Short Description
07-05-2019, 01:57 PM (This post was last modified: 07-05-2019 01:59 PM by John Keith.)
Post: #15
RE: (49G & 38G & Prime) OEIS A111138: No Short Description
My apologies for bringing up an old thread, but I was looking at the OEIS page and i was struck by the last comment: "Partial sums of A002262." This inspired the following program which returns a list of the first T(n) terms, where T(n) is the nth triangular number.

It is reasonably fast: an input of 45 returns the first 1035 terms in about 4.14 seconds on my HP 50. The program requires the ListExt and GoferLists libraries. It could be rewritten without them but the program would be longer and slower.

Code:

\<< \-> n
  \<< 0 n 1 -
    FOR k 0 k LSEQR
    NEXT n \->LIST LXIL
    \<< +
    \>> Scanl1
  \>>
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (49G & 38G & Prime) OEIS A111138: No Short Description - John Keith - 07-05-2019 01:57 PM



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