I have the following sequence of rationals that I want to find the generating function of:
d1 = {1, 1, 0, -(1/3), -(1/12), 3/20, 7/60, -(1/35), -(271/3360), -(31/1440), 2953/75600, 54941/1663200, -(32377/3991680), -(313627/12355200), -(1562149/201801600), 57637519/4540536000, 81128389/6918912000, -(5841262799/2470051584000), -(16908002893/1852538688000), -(122799753991/38398074624000), 38177259047/8439137280000, 73864046480467/16127191342080000, -(422047957817/622452999168000), -(4070047619579/1156513438080000), -(899675774837639/640028142673920000), 9035541454237687/5333567855616000000, 21789055343201563/11556063687168000000, -(139475898744014537/802320993137664000000), -(5703599712765137243/4032177298845696000000), -(100308434035944184283/157254914654982144000000), 580014783870860474531/888388154219704320000000}
FindSequenceFunction gives a DifferenceRoot object that can be evaluated to recover the values of the sequence.
sf = FindSequenceFunction[d1]
(*DifferenceRoot[Function[{y, n}, {(-2 - n^2) y[n] + 3 (1 + n + n^2) y][1 + n]] - 3 (1 + n)^2 y][2 + n]] + 3 (1 + n) (2 + n]) y][3 + n]] == 0, y[1] == 1, y][2] == 1, y][3] == 0}]]*)
By the way, why does Mathematice use these \[FormalN] variables in output like this?
sf[5]==-1/12
(*True*)
Similarly, FindGeneratingFunction returns a DifferentialRoot object:
gf[x_] = FindGeneratingFunction[d1, x]
(*DifferentialRoot[Function[{y,x},{(-6+3 x-3 x^2+2 x^3) y[x]+x (6-3 x+x^3) (y'[x]+x^2 (-3+3 x-3 x^2+x^3) y''[x]==0,y[0]==0,y'[0]==1}]][x]/x*)
However, evaluating gf does not seem to work. Also, when I try to integrate the differential equation found by FindGeneratingFunction directly using NDSolve the input is returned unevaluated.
I can obtain an approximation to the generating function as
f1[x_] = Dot[d1, x^Range[0, Length[d1] - 1]]
but this is of course only valid for small x and I'd prefer having a differential equation that I can solve numerically to working with truncated power series of large degree.
Question: How can I evaluate the
DifferentialRootobject returned byFindGeneratingFunctionin the example described above?


d1 == sf /@ Range[Length[d1]]– Bob Hanlon Nov 08 '14 at 05:22