The goal of this lab is give you practice using loops, and computing numerical sequences.

Throughout the lab, there are questions that you will need to answer. Please submit your answers to the quiz on Canvas. Make sure to follow the directions to receive credit.

While you will not need to submit any files for this lab. It is recommended that you use an R Script to answer the questions. As with HW 1, part of your work in this lab will be used for HW 3.

Question 1: Fibonacci Numbers

Part A

Watch the following video on Fibonacci sequences https://www.youtube.com/watch?v=2tv6Ej6JVho.

Part B

Use a loop that will generate the first 50 Fibonacci numbers. Start with the first two numbers at 0 and 1.

Part C

What is the value for the \(26^{th}\) Fibonacci number?

Question 2: Triangular Numbers

Part A

Watch the following video on Triangular numbers https://www.youtube.com/watch?v=I3t385Oqv58.

Part B

Use a loop that will generate the first 40 Triangular numbers. The first number is 1.

Part C

What is the sum for the first 40 Triangular numbers?

Question 3: Tetrahedral Numbers

Part A

Watch the following video on Tetrahedral numbers: https://www.youtube.com/watch?v=bYSxopkclOI.

The idea with Tetrahedral is that the next number in the sequence is computed by adding the next value from the Triangular numbers.

Part B

Use a loop that will generate the first 39 Tetrahedral numbers. Start with the first number is 1.

Part C

What is the sum for the first 39 Tetrahedral numbers?