OFFSET
0,2
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 floor (h*s + k*t).
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,1,-2,1).
FORMULA
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, 4, 8, 12, 17, 23, 30).
G.f. (-1 - x^2 - 2 x^3 - x^5 - x^7)/((-1 + x)^3 (1 + x + x^2 + x^3 + x^4 + x^5)).
a(n) = n^2/2 + 2/3*n + O(1). - Charles R Greathouse IV, May 31 2026
MATHEMATICA
s = (n^2) = A000290 = (0, 1, 4, 9, 16, 25, 36, ...).
t = ((n+2)^2) = (4, 9, 16, 25, 36, 49, 64, 81, ...).
u(n) = (0, 1, 4, 7, 11, 16, 22, 29, 38, 47, 57, 68, 80, 93, ...).
v(n) = (1, 2, 4, 8, 12, 17, 23, 30, 38, 48, 58, 69, 81, 94, ...).
Table[u[n], {n, 0, z}] (* A393682 *)
Table[v[n], {n, 0, z}] (* A393683 *)
(* Also *)
LinearRecurrence[{2, -1, 0, 0, 0, 1, -2, 1}, {0, 1, 4, 7, 11, 16, 22, 29}, 30] (* A393682 *)
LinearRecurrence[{2, -1, 0, 0, 0, 1, -2, 1}, {1, 2, 4, 8, 12, 17, 23, 30}, 30] (* A393683 *)
PROG
(PARI) a(n)=(3*n^2+4*n+29600\6^(n%6)%6+4)/6 \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Mar 24 2026
STATUS
approved
