OFFSET
0,3
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). This sequence is the (1/3,1/2)-midsequence of (n^2) and (n^3).
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,0,-1,-1,0,2,-1).
FORMULA
a(n) = 2*a(n-1) - a(n-3) - a(n-4) + 2*a(n-6) - a(n-7), with (a(0),...,a(6)) = (0,0,5,16,37,70,120).
G.f.: x^2*(5 + 6*x + 5*x^2 + x^3 + x^4)/((-1 + x)^4*(1 + 2*x + 2*x^2 + x^3)).
EXAMPLE
MATHEMATICA
s[n_] := n^2 ; t[n_] := n^3; {u1, v1} = {1/3, 1/2};
u[n_] := Floor[u1*s[n] + v1*t[n]]
v[n_] := Ceiling[u1*s[n] + v1*t[n]]
tu = Table[u[n], {n, 0, 60}] (* A390565 *)
tv = Table[v[n], {n, 0, 60}] (* A390566 *)
(* Also *)
LinearRecurrence[{2, 0, -1, -1, 0, 2, -1}, {0, 0, 5, 16, 37, 70, 120}, 30] (* A390565 *)
LinearRecurrence[{3, -3, 1, 0, 0, 1, -3, 3, -1}, {0, 1, 6, 17, 38, 71, 120, 188, 278}, 30] (* A390566 *)
PROG
(Python)
def A390565(n): return n**2*(2+3*n)//6 # Chai Wah Wu, Nov 22 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 19 2025
STATUS
approved
