X-Git-Url: https://pwan.org/git/?p=tech-radar.git;a=blobdiff_plain;f=src%2Futil%2Ffib.js;h=2170b4431796ee03df29f51e1e90ca19a61ff07a;hp=93719bca151d4ba5addd009dbba94c02afae24f2;hb=0b37a9ab0ba6f35537d2282ce4219c9c24ddf200;hpb=42530c5418df2e9a47bd8389921114d6315bea92 diff --git a/src/util/fib.js b/src/util/fib.js index 93719bc..2170b44 100644 --- a/src/util/fib.js +++ b/src/util/fib.js @@ -15,7 +15,7 @@ tr.util.Fib = function () { if (length === 0) { return 0; } if (length === 1) { return 1; } - return self.sequence(length).reduce(function (previous, current) { + return self.sequence(length + 1).reduce(function (previous, current) { return previous + current; }, 0); };