login
A389317
Upper (2/3)-midsequence of square numbers and triangular numbers; see Comments.
2
0, 2, 5, 10, 18, 27, 38, 52, 67, 84, 104, 125, 148, 174, 201, 230, 262, 295, 330, 368, 407, 448, 492, 537, 584, 634, 685, 738, 794, 851, 910, 972, 1035, 1100, 1168, 1237, 1308, 1382, 1457, 1534, 1614, 1695, 1778, 1864, 1951, 2040, 2132, 2225, 2320, 2418
OFFSET
0,2
COMMENTS
Suppose that s = (s(n)) and t = (t(n)) are sequences of numbers and r > 0. The lower (r)-midsequence of s and t is given by u = floor(r*(s + t)); the upper r-midsequence of s and t is given by v = ceiling(r*(s + t)). If s and t are linearly recurrent and r is rational, then u and v are linearly recurrent.
FORMULA
a(n) = ceiling((3*n^2 + n)/3).
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
G.f.: x*(-2 - x - 2*x^2 - x^3)/((-1 + x)^3*(1 + x + x^2)).
EXAMPLE
s = (n^2) = A000290 = (0, 1, 4, 9, 16, 25, ...).
t = (n*(n+1)/2) = A000217 = (0, 1, 3, 6, 10, 15, ...).
u(n) = floor((2/3)(0+0, 1+1, 4+3, 9+6, 16+10, ...)) = (0, 1, 4, 10, 17, ...).
v(n) = ceiling((2/3)(0+0, 1+1, 4+3, 9+6, 16+10, ...)) = (0, 2, 5, 10, 18, ...).
MATHEMATICA
s[n_] := n^2; t[n_] := n (n + 1)/2; r = 2/3;
u[n_] := Floor[r*(s[n] + t[n])];
v[n_] := Ceiling[r*(s[n] + t[n])];
Table[u[n], {n, 0, 60}] (* A389316 *)
Table[v[n], {n, 0, 60}] (* A389317 *)
PROG
(Python)
def A389317(n): return n**2+1+(n-1)//3 # Chai Wah Wu, Oct 08 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 03 2025
STATUS
approved