Question: [discrete math]Consider he sequence {si} defined recursively for positive integers i 1 as follows: s1 = 1 si = 2si-1+1 c. write a recursive algorithm

[discrete math]Consider he sequence {si} defined recursively for positive integers i 1 as follows:

s1 = 1

si = 2si-1+1

c. write a recursive algorithm that takes a positive integer n for input and outputs Sn

input: positive n

output: Sn

1. input some positive integer n

2. if n =1 return n

3. ?

4. return Sn

can someone help me with this code? I was just stuck on step 3 but i have no clue if the other steps are right. I just need them in normal english no code required

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!