# Bell triangle

This online calculator constructs the Bell triangle for the given number of rows.

The calculator constructs the **Bell triangle** for the given number of rows. The values of the triangle elements count partitions of a set in which a given triangle element is the largest singleton^{1}. The rightmost value of each row is the **Bell number** for a set of size *n*, where *n* is a row number, starting from 1. That is, rightmost value of *n*-th row is the count of all possible partitions of a set of size *n*. The construction of Bell triangle is described below the calculator. Note that this calculator uses "big integers" library (see Tips and tricks #9: Big numbers), so you can build pretty large triangles.

### Construction of the Bell triangle

The number 1 is placed in first position of first row.

Row 1: 1

Each next row starts from copying the rightmost value of previous row

Row 1: 1

Row 2: 1

Then, the next value in the row is calculated by adding the previous value in the row with the corresponding value from previous row

Row 1: 1

Row 2: 1 2(1+1)

Then

Row 1: 1

Row 2: 1 2

Row 3: 2 3(1+2) 5(2+3)

And so on...

## Comments