Pentanacci Number

Author

Eric W. Weisstein
May 18, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/PentanacciNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PentanacciNumber.html.

©2014 Wolfram Research, Inc. except for portions noted otherwise

Initialization

FibonacciNStep::usage="FibonacciNStep[n,k] gives the nth k-step Fibonacci number."

(*Fibonacci N-Step*)

FibonacciNStep[n_Integer?Negative,k_]:=0
FibonacciNStep[0,k_]:=0
FibonacciNStep[1,k_]:=1
FibonacciNStep[2,k_]:=1
FibonacciNStep[n_,k_]:=Module[{i},
FibonacciNStep[n,k]=Sum[FibonacciNStep[n-i,k],{i,k}]
]

Enumeration

FibonacciNStep[#,5]&/@Range[0,20]

Recurrence

RSolve[{H[0]==0,H[1]==1,H[2]==1,H[3]==2,H[4]==4,H[5]==8,H[n]==H[n-1]+H[n-2]+H[n-3]+H[n-4]+H[n-5]},H[n],n]

Table[RootSum[Function[x,x^5-x^4-x^3-x^2-x-1],(((#)^n)/(-#^4+#^2+8#-1))&],{n,0,20}]

Table[RootSum[Function[x,x^5-x^4-x^3-x^2-x-1],(((#)^(n-3))/(-#^4+#^2+8#-1))&],{n,0,20}]

Ratio of Terms

Reduce[x^5-x^4-x^3-x^2-x-1==0,x,Reals]

N[%,20]

Generating Functions

Ordinary

GeneratingFunction[RootSum[Function[x,x^5-x^4-x^3-x^2-x-1],(((#)^(n-3))/(-#^4+#^2+8#-1))&],n,x]

RootReduce

gf=GeneratingFunction[Normal@RootSum[Function[x,x^5-x^4-x^3-x^2-x-1],(((#)^(n-3))/(-#^4+#^2+8#-1))&],n,x]//RootReduce

Divide@@(Through[{Numerator,Denominator}[Together[gf]]]//FullSimplify//Factor)//Timing

FullSimplify

gf=GeneratingFunction[Normal@RootSum[Function[x,x^5-x^4-x^3-x^2-x-1],(((#)^(n-3))/(-#^4+#^2+8#-1))&],n,x]//FullSimplify

FullSimplify[Through[{Numerator,Denominator}[Together[gf]]]]//Timing

Series[gf,{x,0,10}]//FullSimplify

Series[-(x^4/(-1+x+x^2+x^3+x^4+x^5)),{x,0,10}]

FullSimplify[ExpandAll[gf-(x^4/(-1+x+x^2+x^3+x^4+x^5))]]

PossibleZeroQ[gf+(x^4/(-1+x+x^2+x^3+x^4+x^5))]

expr=N[gf+(x^4/(-1+x+x^2+x^3+x^4+x^5)),100]//FullSimplify

gf=-((x^4)/(-1+x+(x^2)+(x^3)+(x^4)+(x^5)))+((Root[-1+31 #1-88 ((#1)^2)-60 ((#1)^3)+9584 ((#1)^5)&,1])/(1+x Root[1-#1+((#1)^2)-((#1)^3)+((#1)^4)+((#1)^5)&,1]))+((Root[-1+31 #1-88 ((#1)^2)-60 ((#1)^3)+9584 ((#1)^5)&,2])/(1+x Root[1-#1+((#1)^2)-((#1)^3)+((#1)^4)+((#1)^5)&,5]))+((Root[-1+31 #1-88 ((#1)^2)-60 ((#1)^3)+9584 ((#1)^5)&,3])/(1+x Root[1-#1+((#1)^2)-((#1)^3)+((#1)^4)+((#1)^5)&,4]))+((Root[-1+31 #1-88 ((#1)^2)-60 ((#1)^3)+9584 ((#1)^5)&,4])/(1+x Root[1-#1+((#1)^2)-((#1)^3)+((#1)^4)+((#1)^5)&,3]))+((Root[-1+31 #1-88 ((#1)^2)-60 ((#1)^3)+9584 ((#1)^5)&,5])/(1+x Root[1-#1+((#1)^2)-((#1)^3)+((#1)^4)+((#1)^5)&,2]));

FullSimplify[Through[{Numerator,Denominator}[Together[gf]]]]//Timing

RootReduce[Through[{Numerator,Denominator}[Together[gf]]]]//Timing

FullSimplify[%]

Exponential