fbpx
Wikipedia

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:

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

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.[1][2][3][4]

Properties edit

 
Centered square numbers, 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)

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.

See also edit

References edit

  1. ^ Keller, Arthur M. (1982), A first course in computer programming using PASCAL, McGraw-Hill, p. 39.
  2. ^ Peters, James F. (1986), Pascal with program design, Holt, Rinehart and Winston, pp. 137, 154.
  3. ^ Arora, Ashok; Bansal, Shefali (2005), Unix and C Programming, Firewall Media, p. 387, ISBN 9788170087618
  4. ^ Xavier, C. (2007), C Language And Numerical Methods, New Age International, p. 155, ISBN 9788122411744
  5. ^ Foster, Tony (2015), Doubly Triangular Numbers OEIS A002817.

External links edit

  • Floyd's triangle at Rosetta code

floyd, triangle, triangular, array, natural, numbers, used, computer, science, education, named, after, robert, floyd, defined, filling, rows, triangle, with, consecutive, numbers, starting, with, left, corner, 1011, 15the, problem, writing, computer, program,. 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 12 34 5 67 8 9 1011 12 13 14 15The 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 1 2 3 4 Contents 1 Properties 2 See also 3 References 4 External linksProperties edit nbsp Centered square numbers 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 n n2 1 2 the constant of an n n magic square sequence A006003 in the OEIS Summing up the row sums in Floyd s triangle reveals the doubly triangular numbers triangular numbers with an index that is triangular 5 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 See also editPascal s triangleReferences edit 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 Arora Ashok Bansal Shefali 2005 Unix and C Programming Firewall Media p 387 ISBN 9788170087618 Xavier C 2007 C Language And Numerical Methods New Age International p 155 ISBN 9788122411744 Foster Tony 2015 Doubly Triangular Numbers OEIS A002817 External links editFloyd s triangle at Rosetta code Retrieved from https en wikipedia org w index php title Floyd 27s triangle amp oldid 1189864794, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.