fibonacci

$(LUCKY Fibonacci) Numbers (Infinite Range).

fibonacci
(
T = int
)
(
T nth = 0
)
if (
isIntLike!T
)

Examples

import std.range: take;
assert(fibonacci.take(10).equal([1, 1, 2, 3, 5, 8, 13, 21, 34, 55]));
assert(1.fibonacci.take(9).equal([1, 2, 3, 5, 8, 13, 21, 34, 55]));

See Also

Meta