GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Floyd's triangle

Floyd's triangle is a 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 problem of writing a computer program to produce this triangle has been frequently used as an exercise or example for beginning computer programmers, covering the concepts of text formatting and simple loop constructs. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

Floyd's triangle is a 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 problem of writing a computer program to produce this triangle has been frequently used as an exercise or example for beginning computer programmers, covering the concepts of text formatting and simple loop constructs. ==Properties== s, highlighted in red, are in found in the center of the odd rows, and are the sum of successive squares – taking 25 as an example, it is the sum of 16 (rotated yellow square) and the next smaller square, 9 (sum of blue triangles)]] 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 , the constant of an magic square . Summing up the row sums in Floyd's triangle reveals the doubly triangular numbers, triangular numbers with an index that is triangular. 1            = 1 = T(T(1)) 1            = 6 = T(T(2)) 2 + 3 1 2 + 3     = 21 = T(T(3)) 4 + 5 + 6 Each number in the triangle is smaller than the number below it by the index of its row. ==References== ==External links== Floyd's triangle at Rosetta code Coding Bootcamp

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Floyd's triangle". 1776169722. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1348836402

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·