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

 

simona1@sfusd.edu recursion3 > multinacci
prev  |  next  |  chance

The multinacci variation on the Fibonacci sequence uses multiplication instead of addition. In this sequence the first two numbers are 1 and 2. Each subsequent value is the product of the previous two values. The third value is 1*2 or 2. The fourth value is 2*2 or 4. The first nine numbers in this sequence are 1, 2, 2, 4, 8, 32, 256, 8192 and 2097152.


multinacci(0) → 1
multinacci(1) → 2
multinacci(2) → 2

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

public int multinacci(int 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

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy