OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (4,-2,1,-4,2).
FORMULA
Let f(n) = floor(r*floor(s*n)) = A184922(n), where r = 1 + sqrt(2) and s = sqrt(2). Let a(1) = 1. Then a(n) = f(a(n-1)) for n >= 2.
G.f.: x*(1 - 2*x - 2*x^2 - x^3 + x^5)/(1 - 4*x + 2*x^2 - x^3 + 4*x^4 - 2*x^5). - Stefano Spezia, Feb 11 2021
MATHEMATICA
z = 50; r = 1 + Sqrt[2]; s = Sqrt[2]; f[x_] := Floor[r*Floor[s*x]];
Table[f[n], {n, 1, z}] (* A341239 *)
a[1] = 1; a[n_] := f[a[n - 1]];
Table[a[n], {n, 1, z}] (* A341240 *)
LinearRecurrence[{4, -2, 1, -4, 2}, {1, 2, 4, 12, 38, 127}, 30] (* Harvey P. Dale, Jun 14 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 07 2021
STATUS
approved