about | help | code help+videos | done | prefs |
A sequence of values starts with 1. Each term is found by tripling the last term and subtracting 1. Write a function that generates the nth term in the sequence. The first four terms are 1, 5, 14, 41, so if asked for the fourth term the function would return 41. triple_minus_one(2) → 5 triple_minus_one(3) → 14 triple_minus_one(4) → 41 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy