about | help | code help+videos | done | prefs |
sumOfPowers
Write a function to calculate the sum of the powers of two (other than 1) between 0 and n inclusive. sumOfPowers(10) -> 2 + 4 + 8 sumOfPowers(0) → 0 sumOfPowers(10) → 14 sumOfPowers(2) → 2 ...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