Question: Haskell Question: The Triangular Series is: 0, 1, 3, 6, 10, 15, ... Numbers in the series are denoted T(n), where T(0) = 0, T(1)
Haskell Question:
The Triangular Series is: 0, 1, 3, 6, 10, 15, ... Numbers in the series are denoted T(n), where T(0) = 0, T(1) = 1, T(2) = 3, T(3) = 6, etc.
Make a function triSeries that returns the Triangular numbers up to and including T(n). You must use iterate in your code, and you may not use the equality T(n) = choose(n+1, 2) (for n > 0). Example output:
>triSeries 0
[0]
>triSeries 3
[0,1,3,6]
Thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
