TEI4M Engineering Tasks: High-Level Recursion |
Develop high-level recursive functions to accomplish each of the following,
Sum. The sum of the first n natural numbers.
Factorial. The product of first `n` natural numbers (written as `n!`). Special Case: `0! =1`
Fibonacci. `t_1=t_2=1; t_n=t_{n-1}+t_{n-2}`
Pascal's Triangle. `p_{r,0}=p_{r,r}=1; p_{r,c}=p_{r-1,c-1}+p_{r-1,c}`