OFFSET
0,4
COMMENTS
The base row of the addition triangle contains a permutation of the n+1 integers or half-integers {k-n/2, k=0..n}. Each number in a higher row is the sum of the two numbers directly below it. Rows above the base row contain only integers. The base row consists of integers iff n is even.
Because of symmetry, a(n) is also the absolute value of the minimal apex value of an addition triangle whose base is a permutation of {k-n/2, k=0..n}.
a(n) is odd iff n = 2^m and m > 0.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
EXAMPLE
a(3) = 4: max: 4 min: -4
1 3 -1 -3
-1 2 1 1 -2 -1
-3/2 1/2 3/2 -1/2 3/2 -1/2 -3/2 1/2
a(4) = 13: max: 13 min: -13
5 8 -5 -8
0 5 3 0 -5 -3
-2 2 3 0 2 -2 -3 0
-2 0 2 1 -1 2 0 -2 -1 1
MAPLE
a:= n-> add (binomial(n, floor(k/2))*(k-n/2), k=0..n):
seq (a(n), n=0..40);
# second Maple program:
a:= proc(n) option remember; `if`(n<3, n*(n-1)/2,
((2*n^2-6)*a(n-1) +4*(n-1)*(n-4)*a(n-2)
-8*(n-1)*(n-2)*a(n-3)) / (n*(n-2)))
end:
seq(a(n), n=0..40); # Alois P. Heinz, Apr 25 2013
MATHEMATICA
a = DifferenceRoot[Function[{y, n}, {8(n+1)(n+2)y[n] - 4(n-1)(n+2)y[n+1] - (2n^2 + 12n + 12)y[n+2] + (n+1)(n+3)y[n+3] == 0, y[0] == 0, y[1] == 0, y[2] == 1, y[3] == 4}]];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Dec 20 2020, after Alois P. Heinz *)
PROG
(PARI) a(n) = sum(k=0, n, binomial(n, k\2)*(k-n/2)); \\ Michel Marcus, Dec 20 2020
(Python)
from math import comb
def A206603(n): return sum(comb(n, k>>1)*((k<<1)-n) for k in range(n+1))>>1 # Chai Wah Wu, Oct 28 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 10 2012
STATUS
approved