id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

ferrer@hendrix.edu > quadruple_minus_3
prev  |  next  |  chance

A sequence of values starts with 2. Each term is found by quadrupling the last term and subtracting 3. Write a function that generates the nth term in the sequence. The first four terms are 2, 5, 17, 65, so if asked for the fourth term the function would return 65.


quadruple_minus_3(0) → 2
quadruple_minus_3(1) → 5
quadruple_minus_3(2) → 17

...Save, Compile, Run (ctrl-enter)

def quadruple_minus_3(n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Post-solution available

Copyright Nick Parlante 2017 - privacy