#(take % (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1])))
#((apply comp (repeat (- % 2) (fn [x] (conj x (+ (peek x) (peek (pop x))))))) [1 1])
(def compute (fn [x] (conj x (+ (peek x) (peek (pop x))))))
(def fn-seq (repeat (- n 2) compute)
(def fib (apply comp fn-seq))
(fib [1 1])
(fn [x] (conj x (+ (peek x) (peek (pop x)))))
(repeat (- % 2) (fn [x] (conj x (+ (peek x) (peek (pop x))))))
(apply comp fn-seq)
******public class d1t { /** * @param args */ public static void main(String[] args) { /*Scanner scanner=new Scanner(System.in); int n=scanner.nextInt();*/ int[] a=new int[40]; a[0]=0; a[1]=1; for(int...
Fibonacci column deformation title Even if they have played blast The meaning of problems Fibonacci number generation rules f (n) = f (n-1) + f (n-2). before the two input Fibonacci numbers of Number ...
About Fibonacci number, I believe it is no stranger to the subject on which there are also many. I now summarize some interesting properties about it. Basic issue 1. seek Fibonacci column item k Conve...
Thinking First, the use of mating cycles three variables: Second, the use2With variable cycle: ...
We all know that Fibonacci number, and now asked to enter an integer n, you output the n-th Fibonacci number Fibonacci sequence of item (from 0, the first 0 is 0). Fibonacci Recursive issues are class...
The definition of a class Fibs So used Reproduced in: https: //my.oschina.net/u/3243928/blog/890295...
One: the original title We all know that Fibonacci number, and now asked to enter an integer n, you output the n-th Fibonacci number Fibonacci sequence of item (from 0, the first 0 is 0). n <= 39 I...
Fibonacci number (Fibonacci) Fibonacci number (Italian: Successione di Fibonacci), also known as golden series, West Fibonacci series, Feibonaqi number, Fibonacci series, refers to such a series: 0,1,...
Title Description We all know that Fibonacci number, and now asked to enter an integer n, you output the n-th Fibonacci number Fibonacci sequence of item (from 0, the first 0 is 0). n<=39 Time limi...
Title: Seeking the Nth item of the Fiboaccium number (FIB) Idea: The law is the first two and for the third item, set the previous one, the first two variables and current variables, the top two varia...