Summation on HP 42S
|
09-25-2018, 04:15 PM
Post: #19
|
|||
|
|||
RE: Summation on HP 42S
(09-25-2018 12:58 PM)burkhard Wrote: Gauss's solution (which you nicely implemented) is compact, efficient, and much faster than the more obvious way (and least on paper or human brain... not sure for computers/calculators). This is true for computers if you want to calculate one such triangular number, which is the summation of the integers 1 through n. If you want a list of all triangular numbers from 1 through n (aka a cumulative sum), then the straightforward summation is faster because computing each new value requires only one addition. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)