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.

Showing 1-4 of 4 results.

A011971 Aitken's array: triangle of numbers {a(n,k), n >= 0, 0 <= k <= n} read by rows, defined by a(0,0)=1, a(n,0) = a(n-1,n-1), a(n,k) = a(n,k-1) + a(n-1,k-1).

Original entry on oeis.org

1, 1, 2, 2, 3, 5, 5, 7, 10, 15, 15, 20, 27, 37, 52, 52, 67, 87, 114, 151, 203, 203, 255, 322, 409, 523, 674, 877, 877, 1080, 1335, 1657, 2066, 2589, 3263, 4140, 4140, 5017, 6097, 7432, 9089, 11155, 13744, 17007, 21147, 21147, 25287, 30304, 36401, 43833, 52922, 64077, 77821, 94828, 115975
Offset: 0

Views

Author

Keywords

Comments

Also called the Bell triangle or the Peirce triangle.
a(n,k) is the number of equivalence relations on {0, ..., n} such that k is not equivalent to n, k+1 is not equivalent to n, ..., n-1 is not equivalent to n. - Don Knuth, Sep 21 2002 [Comment revised by Thijs van Ommen (thijsvanommen(AT)gmail.com), Jul 13 2008]
Named after the New Zealand mathematician Alexander Craig Aitken (1895-1967). - Amiram Eldar, Jun 11 2021

Examples

			Triangle begins:
00:       1
01:       1      2
02:       2      3      5
03:       5      7     10     15
04:      15     20     27     37     52
05:      52     67     87    114    151    203
06:     203    255    322    409    523    674    877
07:     877   1080   1335   1657   2066   2589   3263   4140
08:    4140   5017   6097   7432   9089  11155  13744  17007  21147
09:   21147  25287  30304  36401  43833  52922  64077  77821  94828 115975
10:  115975 137122 162409 192713 229114 272947 325869 389946 467767 562595 678570
...
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 205.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 212.
  • Donald E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 418).
  • Charles Sanders Peirce, On the Algebra of Logic, American Journal of Mathematics, Vol. 3, pages 15-57, 1880. Reprinted in Collected Papers (1935-1958) and in Writings of Charles S. Peirce: A Chronological Edition (Indiana University Press, Bloomington, IN, 1986).
  • Jeffrey Shallit, A triangle for the Bell numbers, in V. E. Hoggatt, Jr. and M. Bicknell-Johnson, A Collection of Manuscripts Related to the Fibonacci Sequence, 1980, pp. 69-71.

Crossrefs

Borders give Bell numbers A000110. Diagonals give A005493, A011965, A011966, etc., A011968, A011969. Cf. A046934, A011972 (duplicates removed).
Main diagonal is in A094577. Mirror image is in A123346.

Programs

  • GAP
    T:=Flat(List([0..9],n->List([0..n],k->Sum([0..k],i->Binomial(k,i)*Bell(n-k+i))))); # Muniru A Asiru, Oct 26 2018
  • Haskell
    a011971 n k = a011971_tabl !! n !! k
    a011971_row n = a011971_tabl !! n
    a011971_tabl = iterate (\row -> scanl (+) (last row) row) [1]
    -- Reinhard Zumkeller, Dec 09 2012
    
  • Maple
    A011971 := proc(n,k) option remember; if n=0 and k=0 then 1 elif k=0 then A011971(n-1,n-1) else A011971(n,k-1)+A011971(n-1,k-1); fi: end;
    for n from 0 to 12 do lprint([ seq(A011971(n,k),k=0..n) ]); od:
    # Compare the analogue algorithm for the Catalan numbers in A030237.
    BellTriangle := proc(len) local P, T, n; P := [1]; T := [[1]];
    for n from 1 to len - 1 do P := ListTools:-PartialSums([P[-1], op(P)]);
    T := [op(T), P] od; T end:
    BellTriangle(6); ListTools:-Flatten(%); # Peter Luschny, Mar 26 2022
  • Mathematica
    a[0, 0] = 1; a[n_, 0] := a[n, 0] = a[n-1, n-1]; a[n_, k_] := a[n, k] = a[n, k-1] + a[n-1, k-1]; Flatten[ Table[ a[n, k], {n, 0, 9}, {k, 0, n}]] (* Robert G. Wilson v, Mar 27 2004 *)
    Flatten[Table[Sum[Binomial[k, i]*BellB[n-k+i], {i, 0, k}], {n, 0, 9}, {k, 0, n}]] (* Jean-François Alcover, May 24 2016, after Vladeta Jovovic *)
  • Python
    # requires python 3.2 or higher. Otherwise use def'n of accumulate in python docs.
    from itertools import accumulate
    A011971 = blist = [1]
    for _ in range(10**2):
        b = blist[-1]
        blist = list(accumulate([b]+blist))
        A011971 += blist # Chai Wah Wu, Sep 02 2014, updated Chai Wah Wu, Sep 19 2014
    

Formula

Double-exponential generating function: Sum_{n, k} a(n-k, k) x^n y^k / n! k! = exp(e^{x+y}-1+x). - Don Knuth, Sep 21 2002 [U coordinates, reversed]
a(n,k) = Sum_{i=0..k} binomial(k,i)*Bell(n-k+i). - Vladeta Jovovic, Oct 15 2006

Extensions

Peirce reference from Jon Awbrey, Mar 11 2002
Reference to my paper from Jeffrey Shallit, Jan 23 2015
Moved a comment to A056857 where it belonged. - N. J. A. Sloane, May 02 2015.

A094577 Central Peirce numbers. Number of set partitions of {1,2,..,2n+1} in which n+1 is the smallest of its block.

Original entry on oeis.org

1, 3, 27, 409, 9089, 272947, 10515147, 501178937, 28773452321, 1949230218691, 153281759047387, 13806215066685433, 1408621900803060705, 161278353358629226675, 20555596673435403499083, 2896227959507289559616217, 448371253145121338801335489
Offset: 0

Views

Author

Vladeta Jovovic, May 12 2004

Keywords

Comments

Let P(n,k) be the number of set partitions of {1,2,..,n} in which k is the smallest of its block. These numbers were introduced by C. S. Peirce (see reference, page 48). If this triangle is displayed as in A123346 (or A011971) then a(n) = A011971(2n, n) are the central Pierce numbers. - Peter Luschny, Jan 18 2011
Named after the American philosopher, logician, mathematician and scientist Charles Sanders Peirce (1839-1914). - Amiram Eldar, Jun 11 2021

Examples

			n = 1, S = {1, 2, 3}. k = n+1 = 2. Thus a(1) = card { 13|2, 1|23, 1|2|3 } = 3. - _Peter Luschny_, Jan 18 2011
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 4, Section 7.2.1.5.

Crossrefs

Main diagonal of array in A011971.

Programs

  • Maple
    seq(add(binomial(n, k)*(bell(n+k)), k=0..n), n=0..14); # Zerinvary Lajos, Dec 01 2006
    # The objective of this implementation is efficiency.
    # m -> [a(0), a(1), ..., a(m-1)] for m > 0.
    A094577_list := proc(m)
       local A, R, M, n, k, j;
       M := m+m-1; A := array(1..M);
       j := 1; R := 1; A[1] := 1;
       for n from 2 to M do
          A[n] := A[1];
          for k from n by -1 to 2 do
             A[k-1] := A[k-1] + A[k]
          od;
          if is(n,odd) then
             j := j+1; R := R,A[j] fi
       od;
    [R] end:
    A094577_list(100); # example call - Peter Luschny, Jan 17 2011
  • Mathematica
    f[n_] := Sum[Binomial[n, k]*BellB[2 n - k], {k, 0, n}]; Array[f, 15, 0]
  • Python
    # requires python 3.2 or higher. Otherwise use def'n of accumulate in python docs.
    from itertools import accumulate
    A094577_list, blist, b = [1], [1], 1
    for n in range(2,502):
        blist = list(accumulate([b]+blist))
        b = blist[-1]
        blist = list(accumulate([b]+blist))
        b = blist[-1]
        A094577_list.append(blist[-n])
    # Chai Wah Wu, Sep 02 2014, updated Chai Wah Wu, Sep 20 2014

Formula

a(n) = Sum_{k=0..n} binomial(n,k)*Bell(2*n-k).
a(n) = Sum_{k=0..n} (-1)^k*binomial(n, k)*Bell(2*n-k+1).
a(n) = exp(-1)*Sum_{k>=0} (k(k+1))^n/k!. - Benoit Cloitre, Dec 30 2005
a(n) = Sum_{k=0..n} binomial(n,k)*Bell(n+k). - Vaclav Kotesovec, Jul 29 2022

A298804 Triangle T(n,k) (1 <= k <= n) read by rows: A046936 with rows reversed and offset changed to 1.

Original entry on oeis.org

0, 1, 1, 3, 2, 1, 9, 6, 4, 3, 31, 22, 16, 12, 9, 121, 90, 68, 52, 40, 31, 523, 402, 312, 244, 192, 152, 121
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2018, following a suggestion from Don Knuth, Jan 29 2018

Keywords

Comments

This is another version of Moser's version (A046936) of Aitken's array (A011971).
Although offset 0 is better for A011971 and A046936, for this version offset 1 is more appropriate.
Comments from Don Knuth, Jan 29 2018 (Start):
a(n,k) is the number of set partitions (i.e. equivalence classes) in which (i) 1 is not equivalent to 2, ..., nor k; and (ii) the last part, when parts are ordered by their smallest element, has size 1; (iii) that last part isn't simply "1". (Equivalently, n>1.)
It's not difficult to prove this characterization of a(k,n). For example, if we know that there are 22 partitions of {1,2,3,4,5} with 1 inequivalent to 2, and 6 partitions of {1,2,3,4} with
1 inequivalent to 2, then there are 6 partitions of {1,2,3,4,5} with 1 inequivalent to 2 and 1 equivalent to 3. Hence there are 16 with 1 equivalent to neither 2 nor 3.
The same property, but leaving out conditions (ii) and (iii), characterizes Pierce's triangular array A123346. (End)

Examples

			Triangle begins:
0,
1, 1,
3, 2, 1,
9, 6, 4, 3,
31, 22, 16, 12, 9,
121, 90, 68, 52, 40, 31
523, 402, 312, 244, 192, 152, 121
...
		

Crossrefs

A363732 Triangle read by rows. The triangle algorithm applied to (-1)^n/n!.

Original entry on oeis.org

1, -2, 1, 5, -4, 1, -15, 15, -6, 1, 52, -60, 30, -8, 1, -203, 260, -150, 50, -10, 1, 877, -1218, 780, -300, 75, -12, 1, -4140, 6139, -4263, 1820, -525, 105, -14, 1, 21147, -33120, 24556, -11368, 3640, -840, 140, -16, 1, -115975, 190323, -149040, 73668, -25578, 6552, -1260, 180, -18, 1
Offset: 0

Views

Author

Peter Luschny, Jun 18 2023

Keywords

Comments

The triangle algorithm, as understood here, is a transformation that maps a sequence of integers (a(n) : n >= 0) to a polynomial sequence. A polynomial sequence is a sequence of polynomials (P(n,x) : n >= 0) with degree(P(n, x)) = n for all n >= 0.
The polynomials P(n, x) are recursively defined by P(n, x) = p(n, 0, x), where the initial sequence is p(0, m, x) = a(m), and for n > 0 is given by
p(n, m, x) = (m + 1)*p(n - 1, m + 1, x) - (m + 1 - x)*p(n - 1, m, x).
Here we identify the polynomial sequence with the infinite lower triangular array of its coefficients, T(n, k) = [x^k] P(n, x). We call the mapping (a(n) : n >= 0) -> (T(n, k) : 0 <= k <= n) the 'triangle algorithm', following the lead of Kawasaki and Ohno.
Evaluating P(n, x) at different values of x gives rise to a multitude of other sequences; in particular, the transformation a(n) -> b(n) = P(n, 1) will be called the Akiyama-Tanigawa transform of a.
The triangle algorithm was studied by Akiyama and Tanigawa, Chen, Imatomi, Arakawa and Kaneko, Kawasaki and Ohno, and others, at first in connection with the Bernoulli and Poly-Bernoulli numbers.
.
The paradigmatic examples are:
a(n) = 1 -> x^n, the standard base of polynomials, A023531.
a(n) = n + 1 -> binomial(n, k), Pascal triangle, A007318.
a(n) = n + 1 -> P(n, 1) powers of 2, A000079.
a(n) = n + 1 -> P(n, 0) the all 1's sequence A000012.
a(n) = 2^n -> [x^k] P(n, x), A154921.
a(n) = 2^n -> P(n, 0) Fubini numbers, A000670.
a(n) = 2^n -> P(n, 1) ordered set partitions of subsets of [n], A000629.
a(n) = 2^n -> P(n,-1) osp. of [n] with even number of blocks, A052841.
a(n) = 1 / (n + 1) -> [x^k] B(n, x), Bernoulli polynomials, A196838/A196839.
a(n) = 1 / (n + 1) -> B(n, 1), the Bernoulli numbers, A164555/A027642.
a(n) = Chen(n) -> skp(n, x), Swiss-Knife polynomials, A153641.
a(n) = Chen(n) -> P(n, 0), 2^n*Euler(n, 1/2) = Euler(n), A122045.
a(n) = Chen(n) -> P(n, 1), 2^n*Euler(n, 1), A155585.
a(n) = (-1)^n/n! -> [x^k] P(n, x) this "Bell" triangle.
a(n) = (-1)^n/n! -> (-1)^n*P(n, 1) = Bell(n), A000110.
a(n) = (-1)^n/n! -> (-1)^n*P(n,-1) = 2-Bell(n), A005493.
a(n) = 1/n! -> (-1)^n*P(n, 1) = complementary Bell(n), A000587.
a(n) = 1/n! -> (-1)^n*P(n,-1) = complementary 2-Bell(n), A074051.
(For Chen's sequence see A363524.)
.
The present sequence deals with the case of the Bell numbers. In contrast to Aitken's array A011971 and its variants A123346 and A011972, the Bell numbers do not appear as a column of the triangle but as row sums (times (-1)^n), i.e., as values of the associated polynomials at x = 1. Comparing this with a similar situation with the Bernoulli numbers/polynomials, our triangle could be viewed as a more organic generalization of the Bell numbers. Indeed, the names 'Bell triangle' and 'Bell polynomials' would be justified here; but these are already assigned to other concepts.

Examples

			The triangle T(n, k) starts:
  [0]     1;
  [1]    -2,      1;
  [2]     5,     -4,     1;
  [3]   -15,     15,    -6,      1;
  [4]    52,    -60,    30,     -8,    1;
  [5]  -203,    260,  -150,     50,  -10,    1;
  [6]   877,  -1218,   780,   -300,   75,  -12,   1;
  [7] -4140,   6139, -4263,   1820, -525,  105, -14,   1;
  [8] 21147, -33120, 24556, -11368, 3640, -840, 140, -16, 1;
		

Crossrefs

Cf. A293037 (row sums), A000110 (row sums, unsigned), A005493 (alternating row sums, signed).

Programs

  • Maple
    TA := proc(a, n, m, x) option remember; if n = 0 then a(m) else
    normal((m + 1)*TA(a, n - 1, m + 1, x) - (m + 1 - x)*TA(a, n - 1, m, x)) fi end:
    seq(seq(coeff(TA(n -> (-1)^n/n!, n, 0, x), x, k), k = 0..n), n = 0..10);
  • Mathematica
    (* rows[0..n], n[0..oo] *)
    (* row[n]= *)
    n=9;r={};For[a=n+1,a>0,a--,AppendTo[r,(-1)^(a+1)*Sum[StirlingS2[a,k],{k,0,a}]*Product[(2*(a+j))/(2*j+2),{j,0,n-a}]]];r
    (* columns[1..n], n[0..oo] *)
    (* column[n]= *)
    n=0;c={};For[a=1,a<15,a++,AppendTo[c,(-1)^(a+1)*Sum[StirlingS2[a,k],{k,0,a}]*Product[(2*(a+j-1))/(2*j),{j,1,n}]]];c
    (* sequence *)
    s={};For[n=0,n<15,n++,For[a=n+1,a>0,a--,AppendTo[s,(-1)^(a+1)*Sum[StirlingS2[a,k],{k,0,a}]*Product[(2*(a+j))/(2*j+2),{j,0,n-a}]]]];s
    (* Detlef Meya, Jun 22 2023 *)
  • SageMath
    def a(n): return (-1)^n / factorial(n)
    @cached_function
    def p(n, m):
        R = PolynomialRing(QQ, "x")
        if n == 0: return R(a(m))
        return R((m + 1)*p(n - 1, m + 1) - (m + 1 - x)*p(n - 1, m))
    for n in range(10): print(p(n, 0).list())
Showing 1-4 of 4 results.