§2.1 Add the first few integers
Suppose we want the total , where is a positive integer. Pair the first term with the last. Each pair has the same sum. Writing the list twice, once in each direction, makes the pattern work for odd and even alike.
Inline mathematics goes between single dollar signs, as in $n+1$. An unnumbered displayed equation goes between double dollar signs. Use a math code block with a label for a numbered equation you want to refer to later.
```math {@eq:sum}
1+2+\cdots+n=\frac{n(n+1)}{2}.
```
Equation references stay meaningful when earlier material is inserted. Write @eq:sum to produce (2.1) instead of typing its number yourself.
§State the claim and explain it
Theorem and proof blocks separate a claim from its justification.
::: theorem {@thm:sum}
For every positive integer $n$, the sum of the first $n$ positive
integers is $n(n+1)/2$.
:::
::: proof
Write the sum twice, once in each direction. Adding the two rows
term by term gives $n$ copies of $n+1$. Divide by two.
:::
Theorem 2.1
For every positive integer , the sum of the first positive integers is .
Let . Reverse the order of the terms in a second copy of . Each column then adds to .
Dividing by two gives (2.1).
§Check a few cases
A table can carry a caption and a label too.
::: example (Table) [Small cases] {@tab:sums}
| $n$ | Direct sum | $n(n+1)/2$ |
| --- | --- | --- |
| 1 | 1 | 1 |
| 3 | 6 | 6 |
| 5 | 15 | 15 |
:::
Table 2.2 (Small cases)
| Direct sum | ||
|---|---|---|
| 1 | 1 | 1 |
| 3 | 6 | 6 |
| 5 | 15 | 15 |
The agreement in Table 2.2 checks these examples. The proof of Theorem 2.1 is what establishes the formula for every positive integer.
License · CC0 1.0 · Peerpedia collaboration terms