login
Upper (1/2,1/3) midsequence of (n^2) and ((n+1)^2); see Comments.
2

%I #6 Mar 27 2026 00:01:51

%S 1,2,5,10,17,25,35,46,59,74,91,109,129,150,173,198,225,253,283,314,

%T 347,382,419,457,497,538,581,626,673,721,771,822,875,930,987,1045,

%U 1105,1166,1229,1294,1361,1429,1499,1570,1643,1718,1795,1873,1953,2034,2117

%N Upper (1/2,1/3) midsequence of (n^2) and ((n+1)^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_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,0,0,0,1,-2,1).

%F a(n) = 2*a(n-1) - a(n-2) + a(n-6) - 2*a(n-7) + a(n-8), with (a(0),...,a(7)) = (1, 2, 5, 10, 17, 25, 35, 46).

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

%e s = (n^2) = A000290 = (0, 1, 4, 9, 16, 25, 36, ...).

%e t = ((n+1)^2) = (1, 4, 9, 16, 25, 36, 49, 64, ...).

%e u(n) = (0, 1, 5, 9, 16, 24, 34, 45, 59, 73, 90, 108, ...).

%e v(n) = (1, 2, 5, 10, 17, 25, 35, 46, 59, 74, 91, 109, ...).

%t f[n_] := n^2; g[n_] := (n+1)^2; r = 1/2; s = 1/3;

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

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

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

%t Table[u[n], {n, 0, 50}] (* A393678 *)

%t Table[v[n], {n, 0, 50}] (* A393679 *)

%t (* Also *)

%t LinearRecurrence[{1,1,0,-1,-1,1}, {0, 1, 5, 9, 16, 24}, 50] (* A393678 *)

%t LinearRecurrence[{2,-1,0,0,0,1,-2,1}, {1,2,5,10,17,25,35,46}, 50] (* A393679 *)

%Y Cf. A000290, A000578, A393778, A393681.

%K nonn,easy

%O 0,2

%A _Clark Kimberling_, Mar 20 2026