ListFromRational[a_, x_, n_] := 
      CoefficientList[Series[a, {x, 0, n}], x]

RationalFromList[a_, 
        x_] := 
Module[{m, m2, d,  D, N,  k, v,  P, 
          Q}, 
N := Length[a]; 
D := 
          Floor[(N + 1)/2]; 
For[d := 2, 
          d ≤ D, d++, 
m = 
            Table[a[[i + j - 1]], {i, N - 2*d + 2, N - d + 1}, {j, 
                d}]; 
k := 
            NullSpace[m]; 
If[
            Length[k] == 1, 
Q := 
              Sum[k[[1, d - i]]*x^i, {i, 0, 
                  d - 1}]; 
m2 := 
              Table[If[i + j < 2, 0, 
                  a[[i + j - 1]]], 
{i, 2 - d, 
                  N - 2*d + 1}, {j, d}]; 
v := 
              m2 . Transpose[k]; 
P := 
              Sum[v[[i, 1]]*x^(i - 1), {i, 
                  Length[v]}]; 
Return[
                P/Q];
]]; 
Return[
          0]
]

a :=  (1 + x + x^4)/(1 - 2*x - x^2);  a

b := ListFromRational[a, x, 10];  b

RationalFromList[b, x]

tri := {1, 1, 2, 5, 14, 50, 233, 1249, 7595, 49566, 339722, 2406841, 
        17490241, 129664753, 977526957, 7475907149, 57896349553, 
        453382272049, 3585853662949, 28615703421545};  tri

triOP := {1, 1, 2, 6, 17, 73, 389, 2274, 14502, 97033, 672781, 4792530, 
        34911786, 259106122, 1954315346, 14949368524, 115784496932, 
        906736988527};  triOP

RationalFromList[tri, x]

RationalFromList[triOP, x]