Consider the sequence of numbers an given by a1 = 1, and an+1 is the anth prime. Thus the sequence begins 1, 2, 3, 5, 11, 31, ... (the sixth term α6 = 31, since the 11th prime is 31). Write a function called recursive_primes which takes a positive integer n and returns an. Hints: • if tab doesn't work on your browser, you can use spaces to indent. ⚫ this sequence grows very rapidly so we don't expect you to be able to actually compute an for n large.

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter1: Fundamental Concepts Of Algebra
Section1.1: Real Numbers
Problem 27E
icon
Related questions
Question
Consider the sequence of numbers an given by a1
=
1, and an+1 is the anth prime. Thus the
sequence begins
1, 2, 3, 5, 11, 31, ...
(the sixth term α6
=
31, since the 11th prime is 31). Write a function called recursive_primes
which takes a positive integer n and returns an.
Hints:
• if tab doesn't work on your browser, you can use spaces to indent.
⚫ this sequence grows very rapidly so we don't expect you to be able to actually compute an for n large.
Transcribed Image Text:Consider the sequence of numbers an given by a1 = 1, and an+1 is the anth prime. Thus the sequence begins 1, 2, 3, 5, 11, 31, ... (the sixth term α6 = 31, since the 11th prime is 31). Write a function called recursive_primes which takes a positive integer n and returns an. Hints: • if tab doesn't work on your browser, you can use spaces to indent. ⚫ this sequence grows very rapidly so we don't expect you to be able to actually compute an for n large.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell