This refers to @Jack d'Aurizio's second ansatz, just to make it explicite. It is a method which I use if I suspect that my sequence has a recursive structure.
Example in Pari/GP
v=[1,5,19,65,211] \\ initialize a row-vector with values of the sequence
Now recursion means, that we have some transfer [1,5,19] -> [5,19,65] or [1,5,19] -> [19,65,211] by some transfermatrix T by [...] * T = [...]. To be able to find T by a matrix-inversion the brackets in [...] -> [...] should be (quadratic) matrices and not only vectors. So I construct a source-matrix Q and use the maximal possible dimension first:
Q=matrix(3,3,r,c,v[r-1+c]) \\ "source"-matrix with maximal dimension
\\ all entries of v are used
%291 =
[1 5 19]
[5 19 65]
[19 65 211]
First test, whether we really need dimension 3. If the matrix is singular, we only need a smaller dimension for the recursion:
matrank(Q)
%292 = 2
Well, the rank of the matrix is only 2, so we need to do everything with 2x2-matrices only:
Q=matrix(2,2,r,c,v[r-1+c])
%293 =
[1 5]
[5 19]
Now we define the target-matrix Z which should be a "rightshift" of Q by one column:
Z=matrix(2,2,r,c,v[1+r-1+c])
%294 =
[5 19]
[19 65]
From this we can compute the needed transfermatrix T to allow Q*T=Z
T = Q^-1 * Z
%295 =
[0 -6]
[1 5]
The transfermatrix contain the solution which is also known by the earlier answers: $a_{k+1} = -6 a_{k-1} + 5 a_k$ . Powers of $T$ should transfer more positions in $v$:
Q * T
%296 =
[5 19]
[19 65]
Q * T^2
%297 =
[19 65]
[65 211]
Q * T^3
%298 =
[65 211]
[211 665]
and so on ...
Of course this can simply be generalized to higher dimensions. And if in the problem the rank of the initial matrix had been 3 and no more entries in v had been given, we had been lost in the well known arbitrariness...
Remark: we could do even more. When we
diagonalize the transfermatrix
T then we can even find the "Binet-type" solutions with some exponential-formula, where the elements of the generalized sequence in
v can be directly computed putting the index into the exponent of a monomial, and can thus often be generalized to fractional and even complex sequence-
indexes . (As might be known from the Fibonacci-numbers and their Binet-formula - see wikipedia)