Pick a mode with the four tabs across the top of the card: List first N, List a – b, Test a number or Lookup by index; the ? beside each tab describes it. Learn more about the modes
In List first N, type how many terms to show in Show first and click Update; the cards give the count, the largest term and the sum, and the tiles list every term. Learn more about listing terms
In List a – b, type the From index and the To index and click List range; a red box explains a bad range. Learn more about ranges
In Test a number, type a positive integer in Test number and click Check; a green box names the index, a red box says it is not triangular. Learn more about the test
The panel on the right explains the current mode and walks through the arithmetic with your own numbers; it changes with every tab and click. Learn more about the panel
The explorer opens on the List first N tab, one of four tabs across the top of the card; the small ? beside each tab shows what the mode does. Type how many terms you want in the Show first box and click Update or press Enter. Three cards answer at once: Showing gives the count, Largest the last term with its index, and Sum the total of the listed terms, which for triangular numbers is the tetrahedral number N(N+1)(N+2)/6. Under the cards every term is laid out as a tile with its index above its value, so T1=1 to TN can be read in order.
The box accepts 1 to 200: 10 gives T10=55 with the sum 220, 30 gives T30=465 with the sum 4,960, and 300 is capped at 200 terms, ending at T200=20,100 with the sum 1,353,400; a single term gives T1=1. Large values are printed with thousands separators. A count of 0, a decimal or an empty box is refused with "Enter a positive integer." There is no Reset button: type a new count and click Update again. The panel on the right, List first N, states the closed form the tiles come from, and its walkthrough repeats the last term and the sum with your own N. Why the terms are the sums 1+2+⋯+n is explained in what is a triangular number.
Listing a Range of Indexes
DemoThe range tab, 10 to 20, two bad ranges
Step 0 of 4
Click the List a – b tab to list the terms between two positions instead of starting from 1. Type the From index and the To index and click List range or press Enter. The cards give the Countb−a+1, the Smallest term Ta and the Largest term Tb, and the tiles below list every term in between with its index. The tab opens with 5 to 15, eleven terms from T5=15 to T15=120; indexes 10 to 20 give eleven terms from 55 to 210.
Both boxes must hold positive integers, the first no larger than the second, and the range may hold at most 200 terms; otherwise a red box explains: "Enter two positive integer indexes", "From-index must be less than or equal to to-index", or "Range too wide — cap is 200 terms". The panel on the right, List a – b, explains the mode, and its walkthrough names the smallest and largest term of your range. The formula each tile uses is proved in the closed form and why it works.
Testing a Number
DemoThe test tab, 100, 5050, 0
Step 0 of 4
Click the Test a number tab to ask whether a given positive integer is triangular. Type it in the Test number box and click Check or press Enter. A green box with a tick answers yes and names the index, as for the opening value 120, which is T15; a red box with a cross answers no, as for 100, and the walkthrough on the right then shows the two nearest triangular numbers, T13=91 and T14=105. A large value is handled the same way: 5,050 is T100.
The box takes positive integers only; 0, a negative number or a decimal is refused with "Enter a positive integer". The test behind the answer is exact: the explorer checks whether 8m+1 is a perfect square and, when it is, reads the index off its square root, so no list has to be searched. The panel on the right, Test a number, states this rule, and its walkthrough carries out the arithmetic for your number. The rule itself is derived in the membership test.
Looking Up a Term by Index
DemoThe lookup tab, n = 100, n = 1000, n = 0
Step 0 of 4
Click the Lookup by index tab to compute one term directly. Type the position in the Index n box and click Get term or press Enter. Two cards answer: Index repeats n and Value gives Tn with its index as a subscript. The tab opens with n=42, which gives T42=903; n=100 gives 5,050 and n=1,000 gives 500,500. The box takes positive integers only; 0 is refused with "Enter a positive integer index".
The panel on the right has two parts in every mode. How it works names the rule the mode uses, here the closed form Tn=n(n+1)/2, and links to the section of this page that explains it; Walkthrough applies the rule to the numbers you typed, so for the lookup it shows n(n+1)/2 with your n filled in and the product worked out. Both change as soon as you switch tabs or click a button. The closed form and its two proofs are in the closed form and why it works.
What is a Triangular Number?
A triangular number is the count of dots needed to form an equilateral triangle of side length n. Starting with one dot at the top and adding one more dot to each successive row:
T1=1,T2=3,T3=6,T4=10,T5=15,…
The n-th triangular number Tn equals the sum of the first n positive integers:
Tn=1+2+3+⋯+n=k=1∑nk
This sum has a famous closed form, sometimes called the Gauss formula:
Tn=2n(n+1)
The pairing trick that produces the formula: write the sum forward and backward, add term by term to get n pairs of n+1, divide by 2. Carl Friedrich Gauss is said to have rediscovered this at age 9. For deeper coverage see triangular number, arithmetic series, and Gauss summation.
Two distinct proofs of Tn=n(n+1)/2 — both worth knowing.
Algebraic (Gauss pairing). Write the sum and its reverse:
SS=1+2+3+⋯+n=n+(n−1)+(n−2)+⋯+1
Adding column by column gives n pairs each summing to n+1:
2S=n(n+1)⟹S=2n(n+1)
Geometric (rectangle). Two copies of a triangular dot pattern can be rotated and fitted together into an n by n+1 rectangle. The rectangle has n(n+1) dots; one triangle has half:
Tn=2n(n+1)
Why the formula is always an integer. Of n and n+1, one is even, so the product is divisible by 2. The formula produces an integer for every positive integer n.
Given a positive integer m, deciding whether it is triangular reduces to a perfect-square check.
The test.m is triangular if and only if 8m+1 is a perfect square. When it is, the index is
n=28m+1−1
Why it works. From Tn=n(n+1)/2=m, multiply by 8 and add 1:
4n2+4n+1=8m+1⟹(2n+1)2=8m+1
So 8m+1 is a perfect square exactly when m is triangular, and the square root recovers n.
Example. Is 120 triangular? Compute 8⋅120+1=961. Then 961=31, an integer. So n=(31−1)/2=15, meaning 120=T15. Indeed 15⋅16/2=120.
Non-example. Is 100 triangular? Compute 8⋅100+1=801. Then 801≈28.30, not an integer. So 100 is not triangular. The nearest triangular numbers are T13=91 and T14=105.
The identities the test rests on are collected in properties.
Properties and Identities
Triangular numbers satisfy many identities that connect them to other figurate numbers and counting problems.
• Recurrence: Tn=Tn−1+n with T1=1. Each triangular number adds one more row to the triangle. • Binomial coefficient: Tn=(2n+1). The n-th triangular number counts unordered pairs from n+1 objects. • Sum of consecutive triangulars: Tn+Tn−1=n2. Two consecutive triangular numbers add to a perfect square. • Sum of first n triangulars: T1+T2+⋯+Tn=6n(n+1)(n+2)=Ten, the n-th tetrahedral number. • Sum of first n cubes: 13+23+⋯+n3=Tn2. The sum of the first n cubes equals the square of the n-th triangular number. • Hexagonal connection: every hexagonal number is also triangular: Hn=T2n−1. • Square triangulars: a triangular number that is also a perfect square satisfies a Pell equation; examples are 1, 36, 1225, 41616, infinitely many but sparse.
Triangular numbers appear naturally in counting problems where every pair, edge, or comparison is counted once.
• Handshakes. In a room of n+1 people who all shake hands once, the total number of handshakes is Tn. • Pairs from a set. The number of unordered pairs from n+1 items is (2n+1)=Tn. • Round-robin tournaments. A tournament where each of n+1 players plays every other once has Tn matches. • Edges in a complete graph. The complete graph on n+1 vertices, Kn+1, has Tn edges. • Diagonals plus sides. An (n+1)-gon has Tn total segments (diagonals plus sides) connecting its vertices. • Stacked objects. Bowling pins, billiard balls, and any triangularly-stacked array of n rows contain Tn objects. • Lazy caterer. The maximum number of pieces from n straight cuts of a pizza is Tn+1 — the cake number minus a constant.
The counting identity behind these uses is in properties; the sequence's place among the classic ones is triangular numbers.
Triangular Numbers and Pascal's Triangle
Triangular numbers form a diagonal of Pascal's triangle. The third diagonal (counting from 0) reads 1, 3, 6, 10, 15, 21, exactly the triangular numbers.
The identity Tn=(2n+1) says: the n-th triangular number equals the number of ways to choose 2 items from n+1. The connection between binomial coefficients and figurate numbers generalizes: the k-th diagonal of Pascal's triangle gives the k-dimensional figurate numbers.
This nesting is captured by the hockey-stick identity: summing any diagonal up to a point gives the next diagonal's entry. The sum of the first n triangular numbers being Ten is one instance.
The binomial form of Tn is listed in properties; the neighbouring diagonal of squares is square numbers.
Common Mistakes
• Off-by-one in the index.T1=1, not T0=1. The convention starts at n=1. Some sources start at n=0 with T0=0; the explorer here uses T1=1.
• Confusing triangular with square or other figurate numbers. A triangular number counts dots in a triangle; a square number counts dots in a square; a pentagonal number counts dots in a pentagon. The closed forms differ: Tn=n(n+1)/2, Sn=n2, Pn=n(3n−1)/2. Numbers can be both (e.g., 1 and 36 are both triangular and square).
• Misapplying the membership test. The test is 8m+1 a perfect square, not m+1 or 4m+1. The factor 8 comes from completing the square in n2+n=2m.
• Negative or fractional indexes. The closed form n(n+1)/2 technically extends to all real n, but only positive integers are triangular numbers in the standard sense. T1.5 has no combinatorial meaning.
• Confusing the sum with the count.Tn is the sum of the first n integers, not the count. The count is n itself.
Square Numbers — Sn=n2. Dots arranged in a square. Tn+Tn−1=n2 connects triangular and square numbers.
Pentagonal Numbers — Pn=n(3n−1)/2. The next figurate family. Membership test uses 24m+1.
Hexagonal Numbers — Hn=n(2n−1). Every hexagonal number is triangular: Hn=T2n−1.
Tetrahedral Numbers — Ten=n(n+1)(n+2)/6. The sum of the first n triangular numbers; the 3D analog.
Square Triangular Numbers — numbers that are both triangular and square: 1, 36, 1225, 41616, ... They satisfy a Pell equation and grow exponentially.
Arithmetic Series — Tn is the sum of the first n terms of the arithmetic series with a1=1, d=1. The general formula Sn=n(a1+an)/2 specializes to Tn.
Gauss Sum — the classical formula for 1+2+⋯+n, equal to Tn. The cornerstone of summation techniques.
Pascal's Triangle — row positions (2n+1)=Tn. Triangular numbers form the third diagonal.
Binomial Coefficient — Tn=(2n+1). The number of unordered pairs from n+1 objects.
Combinatorics — the discipline. Triangular numbers solve canonical counting problems: pairs, handshakes, edges in complete graphs.
Figurate Numbers — the general family of polygonal and polyhedral counts. Triangular numbers are the 2D, 3-sided case.
Polygonal Numbers — the umbrella term for triangular, square, pentagonal, hexagonal, heptagonal, octagonal, and so on. The r-gonal number formula is Pn(r)=2n[(r−2)n−(r−4)].