OFFSET
0,4
COMMENTS
Suppose that s = (s(n)) and t = (t(n)) are sequences of numbers and h > 0 and k > 0. The lower (h, k)-midsequence of s and t is floor(h*s + k*t); the upper (h, k)-midsequence of s and t is ceiling(h*s + k*t).
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,1,-1,0,0,1,-1,-1,1).
FORMULA
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-6) - a(n-7) - a(n-8) + a(n-9), with (a(0),...,a(8)) = (0, 1, 1, 3, 4, 8, 9, 14, 16).
G.f.: (x (-1 - x^2 - x^3 - 2 x^4 - x^7))/((-1 + x)^3 (1 + x)^2 (1 + x^2 + x^4)).
EXAMPLE
MATHEMATICA
z = 60; f[n_] := Floor[n/2]^2; g[n_] := Ceiling[n/2]^2;
r = 1/3; s = 2/3;
u[n_] := Floor[r*f[n] + s*g[n]]
v[n_] := Ceiling[r*f[n] + s*g[n]]
Table[u[n], {n, 0, z}]
Table[v[n], {n, 0, z}]
(* Alternative: *)
LinearRecurrence[{1, 1, -1, 0, 0, 1, -1, -1, 1}, {0, 0, 1, 3, 4, 7, 9, 13, 16}, 30]
(* Alternative: *)
LinearRecurrence[{1, 1, -1, 0, 0, 1, -1, -1, 1}, {0, 1, 1, 3, 4, 8, 9, 14, 16}, 30]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 16 2026
STATUS
approved
