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.

A323231 A(n, k) = [x^k] (1/(1-x) + x/(1-x)^n), square array read by descending antidiagonals for n, k >= 0.

This page as a plain text file.
%I A323231 #26 Dec 15 2024 07:59:03
%S A323231 1,2,1,1,2,1,1,2,2,1,1,2,3,2,1,1,2,4,4,2,1,1,2,5,7,5,2,1,1,2,6,11,11,
%T A323231 6,2,1,1,2,7,16,21,16,7,2,1,1,2,8,22,36,36,22,8,2,1,1,2,9,29,57,71,57,
%U A323231 29,9,2,1,1,2,10,37,85,127,127,85,37,10,2,1
%N A323231 A(n, k) = [x^k] (1/(1-x) + x/(1-x)^n), square array read by descending antidiagonals for n, k >= 0.
%D A323231 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 154.
%H A323231 G. C. Greubel, <a href="/A323231/b323231.txt">Antidiagonals n = 0..50, flattened</a>
%F A323231 A(n, k) = binomial(n + k - 2, k - 1) + 1. Note that binomial(n, n) = 0 if n < 0.
%F A323231 A(n, k) = A(k, n) with the exception A(1,0) != A(0,1).
%F A323231 A(n, n) = binomial(2*n-2, n-1) + 1 = A323230(n).
%F A323231 From _G. C. Greubel_, Dec 27 2021: (Start)
%F A323231 T(n, k) = binomial(n-2, k-1) + 1 with T(n, 0) = 1 + [n=1], T(n, n) = 1.
%F A323231 T(2*n, n) = A323230(n).
%F A323231 Sum_{k=0..n} T(n,k) = n + 1 + 2^(n-2) - [n=0]/4 + [n=1]/2. (End)
%e A323231 Array starts:
%e A323231 [0] 1, 2,  1,  1,   1,   1,    1,    1,    1,     1,     1, ...
%e A323231 [1] 1, 2,  2,  2,   2,   2,    2,    2,    2,     2,     2, ... A040000
%e A323231 [2] 1, 2,  3,  4,   5,   6,    7,    8,    9,    10,    11, ... A000027
%e A323231 [3] 1, 2,  4,  7,  11,  16,   22,   29,   37,    46,    56, ... A000124
%e A323231 [4] 1, 2,  5, 11,  21,  36,   57,   85,  121,   166,   221, ... A050407
%e A323231 [5] 1, 2,  6, 16,  36,  71,  127,  211,  331,   496,   716, ... A145126
%e A323231 [6] 1, 2,  7, 22,  57, 127,  253,  463,  793,  1288,  2003, ... A323228
%e A323231 [7] 1, 2,  8, 29,  85, 211,  463,  925, 1717,  3004,  5006, ...
%e A323231 [8] 1, 2,  9, 37, 121, 331,  793, 1717, 3433,  6436, 11441, ...
%e A323231 [9] 1, 2, 10, 46, 166, 496, 1288, 3004, 6436, 12871, 24311, ...
%e A323231 .
%e A323231 Read as a triangle (by descending antidiagonals):
%e A323231                                      1
%e A323231                                   2,   1
%e A323231                                 1,   2,   1
%e A323231                              1,   2,   2,   1
%e A323231                            1,   2,   3,   2,   1
%e A323231                         1,   2,   4,   4,   2,   1
%e A323231                       1,   2,   5,   7,   5,   2,  1
%e A323231                     1,  2,   6,  11,  11,   6,   2,  1
%e A323231                   1,  2,   7,  16,  21,  16,   7,  2,  1
%e A323231                 1,  2,  8,  22,  36,  36,  22,   8,  2,  1
%e A323231               1,  2,  9,  29,  57,  71,  57,  29,  9,  2,  1
%e A323231 .
%e A323231 A(0, 1) = C(-1, 0) + 1 = 2 because C(-1, 0) = 1. A(1, 0) = C(-1, -1) + 1 = 1 because C(-1, -1) = 0. Warning: Some computer algebra programs (for example Maple and Mathematica) return C(n, n) = 1 for n < 0. This contradicts the definition given by Graham et al. (see reference). On the other hand this definition preserves symmetry.
%p A323231 Binomial := (n, k) -> `if`(n < 0 and n = k, 0, binomial(n,k)):
%p A323231 A := (n, k) -> Binomial(n + k - 2, k - 1) + 1:
%p A323231 seq(lprint(seq(A(n, k), k=0..10)), n=0..10);
%t A323231 T[n_, k_]:= If[k==0, 1 + Boole[n==1], If[k==n, 1, Binomial[n-2, k-1] + 1]];
%t A323231 Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* _G. C. Greubel_, Dec 27 2021 *)
%o A323231 (Sage)
%o A323231 def Arow(n):
%o A323231     R.<x> = PowerSeriesRing(ZZ, 20)
%o A323231     gf = 1/(1-x) + x/(1-x)^n
%o A323231     return gf.padded_list(10)
%o A323231 for n in (0..9): print(Arow(n))
%o A323231 (Julia)
%o A323231 using AbstractAlgebra
%o A323231 function Arow(n, len)
%o A323231     R, x = PowerSeriesRing(ZZ, len+2, "x")
%o A323231     gf = inv(1-x) + divexact(x, (1-x)^n)
%o A323231     [coeff(gf, k) for k in 0:len-1] end
%o A323231 for n in 0:9 println(Arow(n, 11)) end
%Y A323231 Differs from A323211 only in the second term.
%Y A323231 Rows include: A040000, A000027, A000124, A050407, A145126, A323228.
%Y A323231 Diagonals A(n, n+d): A323230 (d=0), A260878 (d=1), A323229 (d=2).
%Y A323231 Antidiagonal sums are A323227(n) if n!=1.
%Y A323231 Cf. A007318 (Pascal's triangle).
%K A323231 nonn,tabl
%O A323231 0,2
%A A323231 _Peter Luschny_, Feb 10 2019