editing
approved
editing
approved
(* First program *)
digits=100; NSolve[x^4 -x^3 -1==0, x]; k = 1.38028; q = N[k -1/k^3, 20];
m0 = {{0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, -q}};
m[n_] = MatrixPower[m0, n];
Join[{-1, 0}, Table[Floor[Re[m[n][[4, 4]]]], {n, 3, digits}]]
(* Second program *)
approved
editing
editing
approved
LinearRecurrence[{-1, 1, 1, 1, 0, -1}, {-1, 0, -2, 2, -4, 4, -6, 7}, 50] (* Harvey P. Dale, Aug 11 2021 *)
approved
editing
proposed
approved
editing
proposed
(* First program *)
digits=100; NSolve[x^4 -x^3 -1==0, x]; k = 1.38028; q = N[k -1/k^3, 20];
m0 = {{0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, -q}};
m[n_] = MatrixPower[m0, n];
Join[{-1, 0}, Table[Floor[Re[m[n][[4, 4]]]], {n, 3, digits}]]
(* Second program *)
proposed
editing
editing
proposed
editing
proposed