Floyd's triangle is a right-angled triangular array of natural numbers, used in computer science education. It is named after Robert Floyd. It is defined by filling the rows of the triangle with consecutive numbers, starting with a 1 in the top left corner:
The numbers along the left edge of the triangle are the lazy caterer's sequence and the numbers along the right edge are the triangular numbers. The nth row sums to n(n2 + 1)/2, the constant of an n × n magic square (sequence A006003 in the OEIS).
1 = 1 = T(T(1))
1 = 6 = T(T(2))
2 + 3
2 + 3 = 21 = T(T(3))
4 + 5 + 6
- Keller, Arthur M. (1982), A first course in computer programming using PASCAL, McGraw-Hill, p. 39.
- Peters, James F. (1986), Pascal with program design, Holt, Rinehart and Winston, pp. 137, 154.
- Foster, Tony (2015), Doubly Triangular Numbers OEIS A002817.