Find sequence of sequences?
FindSequenceFunction
can find the each individual sequence sec[k]
in terms of a recursion with polynomial coefficients:
FindSequenceFunction[PadRight[sec[5], 20]]
(*
DifferenceRoot[
Function[{\[FormalY], \[FormalN]}, {(-66 + 23 \[FormalN] -
2 \[FormalN]^2) \[FormalY][\[FormalN]] + \[FormalN] (-1 +
2 \[FormalN]) \[FormalY][1 + \[FormalN]] ==
0, \[FormalY][1] == 1}]]
*)
Therefore, it can be used again to try to find the sequence of the coefficients as functions of k
, which it can do in this case.
k0 = 3;
{y0coeff, y1coeff} = FindSequenceFunction /@ Transpose@
Table[
Normal@Last@CoefficientArrays[
First[FindSequenceFunction@PadRight[sec[k], 20]][y, n] //
First,
{y[n], y[1 + n]}],
{k, k0 + 1, 8}] /. n -> #2
(*
{-28 + 15 #2 - 2 #2^2 - 15 #1 + 4 #2 #1 - 2 #1^2 &,
#2 (-1 + 2 #2) &}
*)
The function secFN[k, n]
can be used to generate sec[k]
:
secFN = Function[{k, n},
DifferenceRoot[
Function[{\[FormalY], \[FormalN]},
{y0coeff[k - k0, \[FormalN]] \[FormalY][\[FormalN]] +
y1coeff[k - k0, \[FormalN]] \[FormalY][1 + \[FormalN]] == 0,
\[FormalY][1] == 1}
]
][n + 1]
];
Example:
Table[secFN[5, n], {n, 0, 5}]
(* {1, 45, 210, 210, 45, 1} *)