login
A240134
Numerator of (n-1) * ceiling(n/2) / n.
1
0, 1, 4, 3, 12, 5, 24, 7, 40, 9, 60, 11, 84, 13, 112, 15, 144, 17, 180, 19, 220, 21, 264, 23, 312, 25, 364, 27, 420, 29, 480, 31, 544, 33, 612, 35, 684, 37, 760, 39, 840, 41, 924, 43, 1012, 45, 1104, 47, 1200, 49, 1300, 51, 1404, 53, 1512, 55, 1624, 57, 1740, 59, 1860, 61, 1984, 63, 2112, 65
OFFSET
1,3
COMMENTS
FORMULA
a(2*n) = 2*n-1.
a(2*n-1) = 2*n*(n-1).
From Colin Barker, Apr 02 2014: (Start)
a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6).
G.f.: x^2*(x^4-4*x-1) / ((x-1)^3*(x+1)^3). (End)
a(n) = n - 1 + (2*floor((n+2)/2)^2 - 2*floor((n+2)/2) - n + 1) * (n mod 2). - Wesley Ivan Hurt, Apr 02 2014
a(n) = (n-1)*(n+3-(n-1)*(-1)^n)/4. - Wesley Ivan Hurt, Dec 05 2023
EXAMPLE
a(1) = 0 because the numerator of: {(1-1) * ceiling(1/2) / 1 = 0 * 1 / 1 = (0 / 1)} = 0.
a(2) = 1 because the numerator of: {(2-1) * ceiling(2/2) / 2 = 1 * 1 / 2 = (1 / 2)} = 1.
a(3) = 4 because the numerator of: {(3-1) * ceiling(3/2) / 3 = 2 * 2 / 3 = (4 / 3)} = 4.
MAPLE
A240134:=n->numer( (n-1)*ceil(n/2) / n ); seq(A240134(n), n=1..66);
MATHEMATICA
Table[Numerator[(n - 1) Ceiling[n/2] / n], {n, 100}]
PROG
(PARI) concat(0, Vec(x^2*(x^4-4*x-1)/((x-1)^3*(x+1)^3) + O(x^67))) \\ Colin Barker, Apr 02 2014
(Magma) [(n-1)*(n+3-(n-1)*(-1)^n)/4 : n in [1..66]]; // Wesley Ivan Hurt, Dec 05 2023
(Python)
def A240134(n): return (m:=n>>1)*(m+1)<<1 if n&1 else (n&-2)-1 # Chai Wah Wu, May 07 2026
CROSSREFS
Bisections: A046092 and A005408.
Cf. A142150 (floor(a(n) / n)).
Sequence in context: A091512 A106285 A383485 * A193800 A061727 A327916
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 02 2014
STATUS
approved