Generalizing Fibonacci sequence with SICStus Prolog

后端 未结 6 2010
佛祖请我去吃肉
佛祖请我去吃肉 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:55

    I'd say you're doing something terribly wrong... When you call fib(1, X1), the variable X1 is the number that the function fib will return, in this case, it will be 1, because of the base case fib(1, 1)..

提交回复
热议问题