Lab 8 Problem Solution

$30.00 $24.00

In this assignment, you will write a program calculates [Tetranacci numbers](http://mathworld.wolfram.com/TetranacciNumber.html). The formula for the `n`th Tetranacci number **T<sub>n</sub>** is defined as follows: – T<sub>0</sub> = 0 – T<sub>1</sub> = 1 – T<sub>2</sub> = 1 – T<sub>3</sub> = 2 – T<sub>n</sub> = T<sub>n-1</sub> + T<sub>n-2</sub> + T<sub>n-3</sub> + T<sub>n-4</sub> You need to complete following tasks:…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

In this assignment, you will write a program calculates [Tetranacci numbers](http://mathworld.wolfram.com/TetranacciNumber.html).

The formula for the `n`th Tetranacci number **T<sub>n</sub>** is defined as follows:

– T<sub>0</sub> = 0

– T<sub>1</sub> = 1

– T<sub>2</sub> = 1

– T<sub>3</sub> = 2

– T<sub>n</sub> = T<sub>n-1</sub> + T<sub>n-2</sub> + T<sub>n-3</sub> + T<sub>n-4</sub>

You need to complete following tasks:

1. Your task is to implement a recursive function `tetranacci` which accepts an integer `n` (you may assume that `n >= 0`), and computes the `n`-th Tetranacci number.

2. Print on the screen first 10 Tetranacci numbers.

Lab 8 Problem Solution
$30.00 $24.00