To find the nth Lucas Number in Ruby, you can use an iterative approach or a recursive approach.
Using iterative approach:
main.rb203 chars15 lines
Using recursive approach:
main.rb148 chars7 lines
Both of these methods will find the nth Lucas Number. You can test them by calling them with an integer argument:
main.rb76 chars3 lines
gistlibby LogSnag