Generalizing Fibonacci sequence with SICStus Prolog

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

    Consider fib(N,F1,F2) so you'll be able to replace fib(Nmin1, Xmin1) and fib(Nmin2, Xmin2) with simple fib(Nmin2, Xmin2, Xmin1).

提交回复
热议问题