repl.it
@jrunning/

SurefootedTautHoiho

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
f=->n{n<3?n:n<6?n-1:f[n-1]+f[n-5]}

0.upto(8) do |n|
  printf "%d -> %d\n", n, f[n]
end
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]