Created
May 12, 2018 23:46
-
-
Save jtmcdole/4f924295f8db4b85d9cffc9dd8b85c48 to your computer and use it in GitHub Desktop.
p = p-2 + n*p-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nBonacci(num n, {num a = 0, num b = 1, int max = 10}) { | |
var seq = <num>[a, b]; | |
for (int i = 0; i < max; i++) { | |
seq.add(a + b*n); | |
a = b; | |
b = seq.last; | |
} | |
return seq; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment