Ралица обнови решението на 12.10.2014 20:10 (преди около 10 години)
+def fibonacci(number)
+ return number if (0..1).include? number
+ fibonacci(number-1) + fibonacci(number-2)
+end
+
+def lucas(number)
+ return 2 if (0..1).include? number
+ if number === 2
+ return 1
+ end
+ lucas(number-1) + lucas(number-2)
+end
+
+def summed(number)
+ return fibonacci(number) + lucas(number)
+end
+
+def series(name, number)
+ send name, number
+end