A240542 The midpoint of the (rotated) Dyck path from (0, n) to (n, 0) defined by A237593 has coordinates (a(n), a(n)). Also a(n) is the alternating sum of the n-th row of A235791.
1, 2, 2, 3, 3, 5, 5, 6, 7, 7, 7, 9, 9, 9, 11, 12, 12, 13, 13, 15, 15, 15, 15, 17, 18, 18, 18, 20, 20, 22, 22, 23, 23, 23, 25, 26, 26, 26, 26, 28, 28, 30, 30, 30, 32, 32, 32, 34, 35, 36, 36, 36, 36, 38, 38, 40, 40, 40, 40, 42, 42, 42, 44, 45, 45, 47, 47, 47, 47, 49, 49, 52, 52
Offset: 1
Keywords
Examples
From _Omar E. Pol_, Dec 22 2020: (Start) Illustration of initial terms in two ways in accordance with the sum of the odd-indexed terms of the rows of A237591: . n a(n) _ _ 1 1 _|_| |_|_ 2 2 _|_ _| |_ _| 3 2 _|_ _| |_ _|_ 4 3 _|_ _ _| |_ _ _| 5 3 _|_ _ _| _ |_ _ _|_ _ 6 5 _|_ _ _ _| |_| |_ _ _ _|_| 7 5 _|_ _ _ _| |_| |_ _ _ _|_|_ 8 6 _|_ _ _ _ _| _|_| |_ _ _ _ _|_|_ 9 7 _|_ _ _ _ _| |_ _| |_ _ _ _ _|_ _| 10 7 _|_ _ _ _ _ _| |_| |_ _ _ _ _ _|_| 11 7 _|_ _ _ _ _ _| _|_| |_ _ _ _ _ _|_|_ _ 12 9 _|_ _ _ _ _ _ _| |_ _| |_ _ _ _ _ _ _|_ _| 13 9 _|_ _ _ _ _ _ _| |_ _| |_ _ _ _ _ _ _|_ _| 14 9 _|_ _ _ _ _ _ _ _| _|_| _ |_ _ _ _ _ _ _ _|_|_ _ 15 11 _|_ _ _ _ _ _ _ _| |_ _| |_| |_ _ _ _ _ _ _ _|_ _|_|_ 16 12 |_ _ _ _ _ _ _ _ _| |_ _| |_| |_ _ _ _ _ _ _ _ _|_ _|_| ... Figure 1. Figure 2. . Figure 1 shows the illustration of initial terms taken from the isosceles triangle of A237593. For n = 16 there are (9 + 2 + 1) = 12 cells in the 16th row of the diagram, so a(16) = 12. Figure 2 shows the illustration of initial terms taken from an octant of the pyramid described in A244050 and A245092. For n = 16 there are (9 + 2 + 1) = 12 cells in the 16th row of the diagram, so a(16) = 12. Note that if we fold each level (or row) of that isosceles triangle of A237593 we essentially obtain the structure of the pyramid described in A245092 whose terraces at the n-th level have a total area equal to sigma(n) = A000203(n). (End).
Crossrefs
Programs
-
Mathematica
a[n_] := Sum[(-1)^(k + 1) Ceiling[(n + 1)/k - (k + 1)/2], {k, 1, Floor[-1/2 + 1/2 Sqrt[8 n + 1]]}]; Table[a[n], {n, 40}]
-
PARI
a(n) = sum(k=1, floor(-1/2 + 1/2*sqrt(8*n + 1)), (-1)^(k + 1)*ceil((n + 1)/k - (k + 1)/2)); \\ Indranil Ghosh, Apr 21 2017
-
Python
from sympy import sqrt import math def a(n): return sum((-1)**(k + 1) * int(math.ceil((n + 1)/k - (k + 1)/2)) for k in range(1, int(math.floor(-1/2 + 1/2*sqrt(8*n + 1))) + 1)) print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 21 2017
Formula
a(n) = n - A322141(n). - Omar E. Pol, Dec 22 2020
Extensions
More terms from Omar E. Pol, Apr 16 2014
Definition edited by N. J. A. Sloane, Dec 20 2020
Comments