Rabbits and Recurrence Relations
http://rosalind.info/problems/fib/
Sample input
5 3
Sample output
19
use v6;
sub MAIN(Int $n = 5, Int $k = 3) {
my @fib = 1, 1, * * $k + * ... *;
say @fib[$n-1];
}
# vim: expandtab shiftwidth=4 ft=perl6
See Also
The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society.
All rights reserved.
Built with Podlite ā the markup and publishing tools behind this site.