cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A206604 Number of integers in the smallest interval containing both minimal and maximal possible apex values of an addition triangle whose base is a permutation of n+1 consecutive integers.

This page as a plain text file.
%I A206604 #32 Oct 28 2024 12:56:25
%S A206604 1,1,3,9,27,73,189,465,1115,2601,5973,13489,30149,66641,146233,318369,
%T A206604 689403,1484137,3181797,6790641,14445101,30617841,64724553,136426849,
%U A206604 286926757,601999633,1260707529,2634831585,5497982025,11452601761,23823827825,49484904257
%N A206604 Number of integers in the smallest interval containing both minimal and maximal possible apex values of an addition triangle whose base is a permutation of n+1 consecutive integers.
%C A206604 For n>0 the base row of the addition triangle may contain a permutation of any set {b+k, k=0..n} where b is an integer or a half-integer.  Each number in a higher row is the sum of the two numbers directly below it.  Rows above the base row contain only integers.
%C A206604 a(n) = 3 (mod 4) if n = 2^m with m > 0 and a(n) = 1 (mod 4) else.
%H A206604 Alois P. Heinz, <a href="/A206604/b206604.txt">Table of n, a(n) for n = 0..1000</a>
%F A206604 a(n) = 1 + Sum_{k=0..n} C(n,floor(k/2)) * (2*k-n).
%F A206604 G.f.:  1/(1-x) + (1-sqrt(1-4*x^2)) / (2*x-1)^2.
%F A206604 a(n) = 1 + 2*A206603(n).
%F A206604 a(n) = 1 + A189390(n)-A189391(n).
%F A206604 a(n) ~ n*2^n * (1-2*sqrt(2)/sqrt(Pi*n)). - _Vaclav Kotesovec_, Mar 15 2014
%e A206604 a(3) =  9:   max:   20          min:   12
%e A206604                   9   11             7   5
%e A206604                 3   6   5          5   2   3
%e A206604              1/2 5/2 7/2 3/2    7/2 3/2 1/2 5/2
%e A206604 [12, 13, ..., 20] contains 20-12+1 = 9 integers.
%e A206604 a(4) = 27:   max:   13          min:  -13
%e A206604                    5  8              -5 -8
%e A206604                  0  5  3            0 -5 -3
%e A206604               -2  2  3  0         2 -2 -3  0
%e A206604             -2  0  2  1 -1      2  0 -2 -1  1
%e A206604 [-13, -12, ..., 13] contains 13-(-13)+1 = 27 integers.
%p A206604 a:= n-> 1 +add(binomial(n, floor(k/2))*(2*k-n), k=0..n):
%p A206604 seq(a(n), n=0..40);
%p A206604 # second Maple program
%p A206604 a:= proc(n) option remember; `if`(n<3, 1+n*(n-1),
%p A206604       (3*n^2-6*n+6+(2*n^2-6)*a(n-1)+4*(n-1)*(n-4)*a(n-2)
%p A206604       -8*(n-1)*(n-2)*a(n-3)) / (n*(n-2)))
%p A206604     end:
%p A206604 seq(a(n), n=0..40); # _Alois P. Heinz_, Apr 25 2013
%t A206604 a = DifferenceRoot[Function[{y, n}, {(-2n^2 - 12n - 12) y[n+2] - 3n^2 + 8(n+1)(n+2) y[n] - 4(n-1)(n+2) y[n+1] + (n+1)(n+3) y[n+3] - 12n - 15 == 0, y[0] == 1, y[1] == 1, y[2] == 3, y[3] == 9}]];
%t A206604 Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Dec 20 2020, after _Alois P. Heinz_ *)
%o A206604 (PARI) a(n) = 1 + sum(k=0, n, binomial(n, k\2)*(2*k-n)); \\ _Michel Marcus_, Dec 20 2020
%o A206604 (Python)
%o A206604 from math import comb
%o A206604 def A206604(n): return sum(comb(n,k>>1)*((k<<1)-n) for k in range(n+1))+1 # _Chai Wah Wu_, Oct 28 2024
%Y A206604 Cf. A189390, A189391, A206603.
%K A206604 nonn
%O A206604 0,3
%A A206604 _Alois P. Heinz_, Feb 10 2012