29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
= Pascals Triangle =
|
|
|
|
|
|
== Construction ==
|
|
|
|
Pascals triangle is constructed via staggering numbers in rows, and making each
|
|
entry equal to the sum of the two entries above it.
|
|
|
|
For some entry `(i,j)` where `i` is the row and `j` is the column, the value
|
|
can be calculated via
|
|
|
|
`f(i,j) = f(i-1, j-1) + f(i-1,j)`
|
|
|
|
== Patterns ==
|
|
|
|
* The sum of elements in a row is twice the sum of the row proceeding it. Or in
|
|
other words, the sum of the elements in row `n` is `2^n`.
|
|
* The sum of the square of the elements of row `n` is equal to the middle
|
|
element of row `2n`
|
|
* For some row `n` where `n` is prime, all terms in that row except for the 1s
|
|
are multiples of `n`
|
|
* To count odd terms in a row `n`, convert `n` to binary. Let `x` be the number
|
|
of 1s in the binary value (popcnt) Then the number of odd terms will be `2^x`
|
|
These values are known as [[goulds_sequence]]
|
|
* Every entry in row `2^(n-1) for n>=0` is odd.
|
|
* Diagonals along left and right edges contain only 1s
|
|
* Diagonals next to the edge of the diagonals count upward
|
|
* Next diagonal inward contains the [[triagnular_numbers]]
|