Natalie N.

asked • 03/03/25

3. For each of the sequences in parts (a), (b), and (c), write a Python function that accepts a positive integer n as input and returns an unrounded decimal approximation of the sequence’s nth term

Use these functions to print the terms of each respective sequence for 2 ≤ n ≤ 15.

(a) The sequence of partial continued fractions is defined as

a_(1)=1, a_(2)=1+(1)/(1), a_(3)=1+(1)/(1+(1)/(1)), a_(4)=1+(1)/(1+(1)/(1+(1)/(1))),...

where the nth term of the sequence is defined recursively by an = 1 + 1 /a_n−1 for n ≥ 2.


(b) The sequence of nested roots is defined as

b_(1)=\sqrt(1),b_(2)=\sqrt(1+\sqrt(1)), b_(3)=\sqrt(1+\sqrt(1+\sqrt(1))),b_(4)=\sqrt(1+\sqrt(1+\sqrt(1+\sqrt(1)))),..

where the nth term of the sequence is defined recursively by b_(n)=\sqrt(1+b_(n)-1) for n ≥ 2.


(c) Recall that the Fibonacci numbers are defined recursively by

f_(n)=f_(n-1)+f_(n-2) 2 for n ≥ 3, where F1 = F2 = 1.

The sequence of Fibonacci ratios is defined as cn = Fn/Fn−1 for n ≥ 2.


(d) Plot the sequences an, bn, and cn for 2 ≤ n ≤ 15 in the same graph (see the overview for an example of plotting sequences). Next, compute and print an unrounded decimal approximation of φ = 1+√5/2. What do you notice about this value in relation to the sequences a_n, b_n, and c_n? Write a print statement describing your observations.

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.