login
A389318
Upper (1/4)-midsequence of square numbers and (-1)*(triangular numbers); see Comments.
3
0, 0, 1, 1, 2, 3, 4, 6, 7, 9, 12, 14, 17, 20, 23, 27, 30, 34, 39, 43, 48, 53, 58, 64, 69, 75, 82, 88, 95, 102, 109, 117, 124, 132, 141, 149, 158, 167, 176, 186, 195, 205, 216, 226, 237, 248, 259, 271, 282, 294, 307, 319, 332, 345, 358, 372, 385, 399, 414
OFFSET
0,5
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. Here s = A000290 (squares) and t = (-1)*A000217 (negative triangular numbers). Other (r)-midsequences for the same s and t are as follows:
lower (1/2)-midsequence: A011848
upper (1/2)-midsequence: A054925
lower (3/2)-midsequence: A281026 except for initial 0
lower (5/2)-midsequence: A332495 except for initial 0
lower (1/3)-midsequence: A130518
upper (1/3)-midsequence: A007997
lower (2/3)-midsequence: A128422
upper (2/3)-midsequence: A007980
lower (1/4)-midsequence: A011861
lower (3/4)-midsequence: A389319
upper (3/4)-midsequence: A389320
FORMULA
a(n) = ceiling((n^2 - n)/8).
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3) - 4*a(n-4) + 4*a(n-5) - 4*a(n-6) + 4*a(n-7) - 3*a(n-8) + a(n-9).
G.f.: -x^2*(1 - 2*x + 3*x^2 - 3*x^3 + 3*x^4 - 2*x^5 + x^6)/((-1 + x)^3*(1 + x^2 + x^4 + x^6)).
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((1/4)(0-0, 1-1, 4-3, 9-6, 16-10, ...)) = (0, 0, 0, 0, 1, 2, 3, 5, ...).
v(n) = ceiling((1/4)(0-0, 1-1, 4-3, 9-6, 16-10, ...)) = (0, 0, 1, 1, 2, 3, 4, 6, ...).
MATHEMATICA
s[n_] := n^2; t[n_] := -n (n + 1)/2; r = 1/4;
u[n_] := Floor[r*(s[n] + t[n])]
v[n_] := Ceiling[r*(s[n] + t[n])]
Table[u[n], {n, 0, 60}]
Table[v[n], {n, 0, 60}]
PROG
(Python)
def A389318(n): return (n*(n-1)-1>>3)+1 # Chai Wah Wu, Oct 07 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 03 2025
STATUS
approved