Generalizing Fibonacci sequence with SICStus Prolog

后端 未结 6 2014
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-19 08:00

I\'m trying to find a solution for a query on a generalized Fibonacci sequence (GFS). The query is: are there any GFS that have 885 as their 12th number? The initial 2 numbe

6条回答
  •  旧巷少年郎
    2021-01-19 08:33

    Without the base cases, fib/2 has no solution; no matter how you call it in fib2. Note: if you use recursion, you need at least one base case.

提交回复
热议问题