What are some algorithms for finding a closed form function given an integer sequence?

后端 未结 7 1059
刺人心
刺人心 2020-12-30 14:58

I\'m looking form a programatic way to take an integer sequence and spit out a closed form function. Something like:

Given: 1,3,6,10,15

Return: n(n+1)/2

7条回答
  •  悲&欢浪女
    2020-12-30 15:12

    The Axiom computer algebra system includes a package for this purpose. You can read its documentation here.

    Here's the output for your example sequence in FriCAS (a fork of Axiom):

    (3) -> guess([1, 3, 6, 10, 15])
    
                     2
                    n  + 3n + 2
    (3)  [[function= -----------,order= 0]]
                         2
    Type: List(Record(function: Expression(Integer),order: NonNegativeInteger))
    

提交回复
热议问题