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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!