login
Upper (1/3,2/3) midsequence of (floor[n/2]^2) and (ceiling[n/2]^2); see Comments.
1

%I #25 Jun 21 2026 15:38:57

%S 0,1,1,3,4,8,9,14,16,22,25,33,36,45,49,59,64,76,81,94,100,114,121,137,

%T 144,161,169,187,196,216,225,246,256,278,289,313,324,349,361,387,400,

%U 428,441,470,484,514,529,561,576,609,625,659,676,712,729,766,784,822,841,881,900

%N Upper (1/3,2/3) midsequence of (floor[n/2]^2) and (ceiling[n/2]^2); see Comments.

%C 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).

%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1,0,0,1,-1,-1,1).

%F 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).

%F G.f.: (x (-1 - x^2 - x^3 - 2 x^4 - x^7))/((-1 + x)^3 (1 + x)^2 (1 + x^2 + x^4)).

%e s(n) = A008794(n+1): (0, 1, 1, 4, 4, 9, 9, 16, 16, ...).

%e t(n) = A008794(n+2): (1, 1, 4, 4, 9, 9, 16, 16, 25, ...).

%e (u(n)) = (0, 0, 1, 3, 4, 7, 9, 13, 16, 22, 25, 32, 36, 44, ...).

%e (v(n)) = (0, 1, 1, 3, 4, 8, 9, 14, 16, 22, 25, 33, 36, 45, ...).

%t z = 60; f[n_] := Floor[n/2]^2; g[n_] := Ceiling[n/2]^2;

%t r = 1/3; s = 2/3;

%t u[n_] := Floor[r*f[n] + s*g[n]]

%t v[n_] := Ceiling[r*f[n] + s*g[n]]

%t Table[u[n], {n, 0, z}]

%t Table[v[n], {n, 0, z}]

%t (* Alternative: *)

%t LinearRecurrence[{1, 1, -1, 0, 0, 1, -1, -1, 1}, {0, 0, 1, 3, 4, 7, 9, 13, 16}, 30]

%t (* Alternative: *)

%t LinearRecurrence[{1, 1, -1, 0, 0, 1, -1, -1, 1}, {0, 1, 1, 3, 4, 8, 9, 14, 16}, 30]

%Y Cf. A389123, A396811, A146994.

%K nonn,easy

%O 0,4

%A _Clark Kimberling_, Jun 16 2026