Floyd's triangle
Encyclopedia
Floyd's triangle is a right-angled
Right angle
In geometry and trigonometry, a right angle is an angle that bisects the angle formed by two halves of a straight line. More precisely, if a ray is placed so that its endpoint is on a line and the adjacent angles are equal, then they are right angles...

 triangular
Triangle
A triangle is one of the basic shapes of geometry: a polygon with three corners or vertices and three sides or edges which are line segments. A triangle with vertices A, B, and C is denoted ....

 array of natural number
Natural number
In mathematics, the natural numbers are the ordinary whole numbers used for counting and ordering . These purposes are related to the linguistic notions of cardinal and ordinal numbers, respectively...

s, used in computer science education. It is named after Robert Floyd
Robert Floyd
Robert W Floyd was an eminent computer scientist.His contributions include the design of the Floyd–Warshall algorithm , which efficiently finds all shortest paths in a graph, Floyd's cycle-finding algorithm for detecting cycles in a sequence, and his work on parsing...

. It is defined by filling the rows of the triangle with consecutive numbers, starting with a 1 in the top left corner:

1
23
456
78910
1112131415

Beginning programmers are often assigned the task of writing a program to print out the table in the format shown.

The numbers along the left edge of the triangle are the lazy caterer's sequence
Lazy caterer's sequence
The lazy caterer's sequence, more formally known as the central polygonal numbers, describes the maximum number of pieces of a circle that can be made with a given number of straight cuts. For example, three cuts across a pancake will produce six pieces if the cuts all meet at a common point, but...

 and the numbers along the right edge are the triangular number
Triangular number
A triangular number or triangle number numbers the objects that can form an equilateral triangle, as in the diagram on the right. The nth triangle number is the number of dots in a triangle with n dots on a side; it is the sum of the n natural numbers from 1 to n...

s. The nth row sums to n(n2 + 1)/2 .
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK