Skip to content

Instantly share code, notes, and snippets.

@jtmcdole
Created May 12, 2018 23:46
Show Gist options
  • Save jtmcdole/4f924295f8db4b85d9cffc9dd8b85c48 to your computer and use it in GitHub Desktop.
Save jtmcdole/4f924295f8db4b85d9cffc9dd8b85c48 to your computer and use it in GitHub Desktop.
p = p-2 + n*p-1
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