# Guess special function from few power series coefficients

I remember having come across a nifty function that guesses some special functions taking some specific values for its parameters, such that when expanded in a power series, its coefficients match a finite set of input coefficients (probably first $$n$$ coefficients where $$n$$ is finite). I am not able to trace it somehow. Can anyone help me?

Example:

The first 5 coefficients in the power series expansion of a function are: $$\{\frac{1}{2},-\frac{1}{24},\frac{1}{72},-\frac{1}{144},\frac{11}{2592}\}$$. What is one such $$C^\infty$$ non-polynomial function?

I am hoping the answer is some generalized hypergeometric function with particular values for its parameters.

Edit 1:

FindGeneratingFunction[] was the function I was looking for. However, it doesn't seem to work here. What could be some alternative ways to do this?

Edit 2:

The last term in my example list should be $$\frac{11}{2592}$$. I have updated it now. I had solved for a few terms of the function as follows. I am posting it here for reference:

In[24]:= ClearAll["Global*"];
ϕcl[λ_, J_] = ϕ /. Solve[ϕ/G + λ/6*ϕ^3 == J, ϕ][[1]];
W[λ_, J_] = Integrate[ϕcl[λ, J], J];
Series[W[λ, J], {J, 0, 20}, {λ, 0, 20}] // PowerExpand // Simplify // Normal

Out[27]= (G J^2)/2 - 1/(G^2 λ) - 1/24 G^4 J^4 λ +
1/72 G^7 J^6 λ^2 - 1/144 G^10 J^8 λ^3 + (
11 G^13 J^10 λ^4)/2592 - (91 G^16 J^12 λ^5)/31104 + (
17 G^19 J^14 λ^6)/7776 - (
323 G^22 J^16 λ^7)/186624 + (
4807 G^25 J^18 λ^8)/3359232 - (
16445 G^28 J^20 λ^9)/13436928


Ignore the second term, and pick the rest of the coefficients. It is great to see that after feeding the first 8 coefficients, it spits out a hypergeometric function!

In[31]:= FindGeneratingFunction[{1/2, -(1/24), 1/72, -(1/144), 11/2592,
-(91/31104), 17/7776, -(323/186624)}, x]

Out[31]= (1 - Hypergeometric2F1[-(2/3), -(1/3), 1/2, -((9 x)/8)])/x


From a look at the code that generates the series up to the FindGeneratingFunction[], can anyone suggest a better way I could have arrived at this result?

• Are those five all you have? FindSequenceFunction[] usually does much better if it has a lot of sequence elements to try stuff with. Mar 20 '18 at 8:17
• @J.M. Yeah. Otherwise, can one write a short code to do so? Mar 20 '18 at 8:28
• In addition to very relevant links of J.M. I would like to add that any trinomial equation has a solution that can be written in terms of series involving the generalized Catalan coefficients. For integer powers, they can be written in terms of hypergeometric functions mathoverflow.net/questions/249060/… Mar 22 '18 at 9:40
• See also this paper of Aoyama, where the root is expressed in terms of a contour integral link.springer.com/article/10.1007/BF01313922 . Mar 22 '18 at 9:45

As another demonstration of how you can make all sorts of conclusions if you don't have enough data:

f[z_] = PadeApproximant[FromDigits[{11/2592, -1/144, 1/72, -1/24, 1/2}, z], {z, 0, 2}]
(1/2 + 3 z/8 + 5 z^2/144)/(1 + 5 z/6 + z^2/9)

Series[f[z], {z, 0, 6}]
1/2 - z/24 + z^2/72 - z^3/144 + 11 z^4/2592 - 43 z^5/15552 + 19 z^6/10368 + O[z]^7


The OP has provided the source of the power series coefficients, so here's a way to derive them. The procedure is completely analogous to what Chip did in this answer:

coef[k_] =
Refine[FunctionExpand[SeriesCoefficient[Root[Function[ϕ, -6 J/λ + 6 ϕ/(G λ) + ϕ^3], 1],
{J, 0, k}]], k >= 0];

Sum[coef[k] J^(k + 1)/(k + 1), {k, 0, ∞}] // FullSimplify
(1 - Hypergeometric2F1[-2/3, -1/3, 1/2, -9/8 G^3 J^2 λ])/(G^2 λ)

Series[(1 - Hypergeometric2F1[-2/3, -1/3, 1/2, -9/8 G^3 J^2 λ])/(G^2 λ),
{λ, 0, 6}] /. {G -> 1, J -> 1}
1/2 - λ/24 + λ^2/72 - λ^3/144 + 11 λ^4/2592 - 91 λ^5/31104 + 17 λ^6/7776 + O[λ]^7


Finally, this can be expressed in terms of elementary functions (as expected):

FullSimplify[FunctionExpand[
(1 - Hypergeometric2F1[-2/3, -1/3, 1/2, -9/8 G^3 J^2 λ])/(G^2 λ)]]
(1 - Sqrt[1 + 9/8 G^3 J^2 λ] Cosh[1/3 ArcSinh[(3 G^(3/2) J Sqrt[λ])/(2 Sqrt[2])]] +
(9 G^(3/2) J Sqrt[λ] Sinh[1/3 ArcSinh[(3 G^(3/2) J Sqrt[λ])/
(2 Sqrt[2])]])/(2 Sqrt[2]))/(G^2 λ)


As to how one might have obtained that result by hand, see this or this. Using the formulae in those references:

expr = Simplify[Integrate[2 Sqrt[2] Sqrt[1/(G λ)]
Sinh[1/3 ArcSinh[(3 G^(3/2) J Sqrt[λ])/(2 Sqrt[2])]], J], λ > 0];

FullSimplify[Series[expr, {λ, 0, 6}] /. {G -> 1, J -> 1}]

• Thanks for the references! Mar 20 '18 at 14:23

Obviously, there are infinitely many $C^\infty$ functions with those first five power series coefficients. The obvious trivial example being the power series truncated at fourth order.

If you have reason to suspect that it may be a hypergeometric function, you can always find a hypergeometric function to fit the first five coefficients in the power series:

knowncoefficients = {1/2, -1/24, 1/72, -1/144, 11/576};
ansatz = e Hypergeometric2F1[a, b, c, d z];
ansatzcoefficients = Table[SeriesCoefficient[ansatz, {z, 0, i}], {i, 0, 4}];
ansatz /. Simplify @ Solve[Thread[knowncoefficients == ansatzcoefficients], {a, b, c, d, e}]

Out[]:={
1/2 Hypergeometric2F1[1/542 (-959-Sqrt[1088785]),  1/542 (-959+Sqrt[1088785]), -(312/101), -((271 z)/606)],
1/2 Hypergeometric2F1[1/542 (-959-Sqrt[1088785]),  1/542 (-959+Sqrt[1088785]), -(312/101), -((271 z)/606)]
}


Of course, this is not very convincing, since we just solved five equations for five unknowns. The proof of the pudding would be in finding the sixth coefficient and seeing that it agreed.

• I will find that out and post it ASAP Mar 20 '18 at 9:04
• I would be very surprised if it agreed. Mar 20 '18 at 9:24

If you only had five terms, you could still try to expand them into an integer sequence by multiplying by obvious powers and factorials. In this case, by looking at a few FactorInteger decompositions of denominators, it becomes clear that there are only factors of 2 and 3 in the denominators, suggesting that

L = {1/2, -1/24, 1/72, -1/144, 11/2592};
Table[-(-1)^n 2^(n + 1) 3^(n - 1) L[[n]], {n, 5}]


{2, 1, 2, 6, 22}

looks like the beginning of an integer sequence. Feeding it into the Online Encyclopedia of Integer Sequences with OEISlookup[{2, 1, 2, 6, 22}] (see below) lands us uniquely on A000139, with explicit formula

Table[(2 (3 n)!)/((1 + n)! (1 + 2 n)!), {n, 0, 4}]


{2, 1, 2, 6, 22}

(notice the offset by one in the index). From this information, we guess the coefficient sequence

Table[-(-1)^n (2 (3 (-1 + n))!)/(2^(n + 1) 3^(n - 1) (1 + 2 (-1 + n))! n!), {n, 5}]


{1/2, -1/24, 1/72, -1/144, 11/2592, -91/31104, 17/7776, -323/186624, 4807/3359232, -16445/13436928}

and the generating function

Sum[-(-1)^n (2 (3 (-1 + n))!)/(2^(n + 1) 3^(n - 1) (1 + 2 (-1 + n))! n!) z^n, {n, ∞}]


1 - Hypergeometric2F1[-2/3, -1/3, 1/2, -9 z/8]

OEIS lookup helper:

OEISlookup[L_?(VectorQ[#, IntegerQ] &)] := SystemOpen[
"https://oeis.org/search?q=" <> StringRiffle[ToString /@ L, ","]]
`