Skip to main content
Improved formatting
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

Use FindGeneratingFunctionFindGeneratingFunction and SeriesCoefficientSeriesCoefficient:

In[1]:= FindGeneratingFunction[{15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23}, x]

FindGeneratingFunction[
  {15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23}, x]

Out[1]= (15 - 13x^4)/((-1 + x)^2(1 + x + x^2 + x^3))

(15 - 13*x^4)/((-1 + x)^2*(1 + x + x^2 + x^3))

The formula:

In[2]:= FullSimplify[SeriesCoefficient[%, {x, 0, n}], Element[n, Integers] && n >= 0]

FullSimplify[SeriesCoefficient[%, {x, 0, n}], Element[n, Integers] && n >= 0]

Out[2]= (1/4)(57 + (-1)^n + 2n + 2Cos[(nPi)/2] + 2Sin[(nPi)/2])

(1/4)*(57 + (-1)^n + 2*n + 2*Cos[(n*Pi)/2] + 2*Sin[(n*Pi)/2])

Verification:

In[3]:= Table[%, {n, 0, 30}]

Table[%, {n, 0, 30}]

Out[3]= {15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29}

{15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 
 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29}

Use FindGeneratingFunction and SeriesCoefficient:

In[1]:= FindGeneratingFunction[{15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23}, x]

Out[1]= (15 - 13x^4)/((-1 + x)^2(1 + x + x^2 + x^3))

The formula:

In[2]:= FullSimplify[SeriesCoefficient[%, {x, 0, n}], Element[n, Integers] && n >= 0]

Out[2]= (1/4)(57 + (-1)^n + 2n + 2Cos[(nPi)/2] + 2Sin[(nPi)/2])

Verification:

In[3]:= Table[%, {n, 0, 30}]

Out[3]= {15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29}

Use FindGeneratingFunction and SeriesCoefficient:

FindGeneratingFunction[
  {15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23}, x]
(15 - 13*x^4)/((-1 + x)^2*(1 + x + x^2 + x^3))

The formula:

FullSimplify[SeriesCoefficient[%, {x, 0, n}], Element[n, Integers] && n >= 0]
(1/4)*(57 + (-1)^n + 2*n + 2*Cos[(n*Pi)/2] + 2*Sin[(n*Pi)/2])

Verification:

Table[%, {n, 0, 30}]
{15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 
 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29}
Source Link
Charles P.
  • 356
  • 3
  • 3

Use FindGeneratingFunction and SeriesCoefficient:

In[1]:= FindGeneratingFunction[{15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23}, x]

Out[1]= (15 - 13x^4)/((-1 + x)^2(1 + x + x^2 + x^3))

The formula:

In[2]:= FullSimplify[SeriesCoefficient[%, {x, 0, n}], Element[n, Integers] && n >= 0]

Out[2]= (1/4)(57 + (-1)^n + 2n + 2Cos[(nPi)/2] + 2Sin[(nPi)/2])

Verification:

In[3]:= Table[%, {n, 0, 30}]

Out[3]= {15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29}