Alternating permutation
Adapted from Wikipedia Β· Discoverer experience
In combinatorial mathematics, an alternating permutation (or zigzag permutation) is a special way of arranging numbers. It involves taking the numbers from 1 up to some number n and putting them in a row so that each number is bigger or smaller than the one before it, going back and forth. For example, with the numbers 1, 2, 3, and 4, one alternating permutation is 1, 3, 2, 4 because each number switches between higher and lower than the one before it.
These kinds of arrangements have been studied for a long time. Figuring out how many ways you can arrange the numbers {1, ..., n} in this alternating way is called AndrΓ©'s problem. The answers to this problem are special numbers known as Euler numbers, zigzag numbers, or up/down numbers.
Depending on whether n is even or odd, these numbers have different names. When n is even, the number is called a secant number, and when n is odd, it is called a tangent number. These names come from work done on a special math expression called the generating function for these sequences.
Definitions
A permutation is a way of arranging numbers in a row. An alternating permutation is a special kind of arrangement where the numbers go up and down, like a zigzag. For example, in the number pattern 1, 3, 2, 4, the numbers rise (1 to 3), then fall (3 to 2), then rise again (2 to 4).
Some people call this type of pattern "up-down," where the first number is smaller than the next, which is larger than the one after, and so on. Others might call it "down-up," which is the opposite pattern. Both types are considered alternating permutations. There is a simple way to switch between these two patterns by using a special math rule. The very smallest patterns, like having no numbers or just one number, are also considered alternating.
AndrΓ©'s theorem
An alternating permutation is a special way of arranging numbers so that each number is either bigger or smaller than the one before it, switching each time. For example, in the number arrangement 1, 3, 2, 4, we see that 1 is less than 3, which is greater than 2, which is less than 4.
This idea was studied by a mathematician named DΓ©sirΓ© AndrΓ© in the 1800s. He found patterns in how often these special arrangements appear, and his work is called AndrΓ©'s theorem. The numbers that show how often these arrangements happen are known by several names, including Euler numbers. The first few of these numbers are 1, 1, 1, 2, 5, 16, and so on.
Main article: Euler numbers
Seidel's Algorithm
In 1877 Philipp Ludwig von Seidel shared a smart way to figure out a special number called An.
- Start with the number 1 in the first row. For each new row, if the row number is odd, place the number from the left end of the row above it at the start, and fill the row by adding the number to its left and the number above it.
- At the end of each row, repeat the last number.
- If the row number is even, do the same thing but go from right to left.
This method was used again by others and helps in calculating certain numbers, like Bernoulli numbers and Euler numbers, using just simple math steps.
Only OEIS:Β A000657 and OEIS:Β A214267 appear in the OEIS.
This links to OEIS:Β A239005.
The first column links to OEIS:Β A122045.
The first row links to OEIS:Β A155585.
The first column links to OEIS:Β A000111.
| 1 | ||||||||||||
| 1 | 1 | |||||||||||
| 2 | 2 | 1 | ||||||||||
| 2 | 4 | 5 | 5 | |||||||||
| 16 | 16 | 14 | 10 | 5 | ||||||||
| 16 | 32 | 46 | 56 | 61 | 61 | |||||||
| 272 | 272 | 256 | 224 | 178 | 122 | 61 |
| 1 | ||||||||||||
| 0 | 1 | |||||||||||
| β1 | β1 | 0 | ||||||||||
| 0 | β1 | β2 | β2 | |||||||||
| 5 | 5 | 4 | 2 | 0 | ||||||||
| 0 | 5 | 10 | 14 | 16 | 16 | |||||||
| β61 | β61 | β56 | β46 | β32 | β16 | 0 |
| 1 | 1 | β 1/2β | 0 | ββ 1/4β | ββ 1/4β | ββ 1/8β |
| 0 | 1 | β 3/2β | 1 | 0 | ββ 3/4β | |
| β1 | β1 | β 3/2β | 4 | β 15/4β | ||
| 0 | β5 | ββ 15/2β | 1 | |||
| 5 | 5 | ββ 51/2β | ||||
| 0 | 61 | |||||
| β61 |
| 1 | 1 | 0 | β2 | 0 | 16 | 0 |
| 0 | β1 | β2 | 2 | 16 | β16 | |
| β1 | β1 | 4 | 14 | β32 | ||
| 0 | 5 | 10 | β46 | |||
| 5 | 5 | β56 | ||||
| 0 | β61 | |||||
| β61 |
| 1 | 2 | 2 | β4 | β16 | 32 | 272 |
| 1 | 0 | β6 | β12 | 48 | 240 | |
| β1 | β6 | β6 | 60 | 192 | ||
| β5 | 0 | 66 | 32 | |||
| 5 | 66 | 66 | ||||
| 61 | 0 | |||||
| β61 |
| 1 | 2 | 2 | β 3/2β | 1 | β 3/4β | β 3/4β |
| β1 | 0 | β 3/2β | 2 | β 5/4β | 0 | |
| β1 | β3 | ββ 3/2β | 3 | β 25/4β | ||
| 2 | β3 | ββ 27/2β | β13 | |||
| 5 | 21 | ββ 3/2β | ||||
| β16 | 45 | |||||
| β61 |
| 0 | β1 | β1 | 2 | 5 | β16 | β61 |
| β1 | 0 | 3 | 3 | β21 | β45 | |
| 1 | 3 | 0 | β24 | β24 | ||
| 2 | β3 | β24 | 0 | |||
| β5 | β21 | 24 | ||||
| β16 | 45 | |||||
| β61 |
| 2 | 1 | β1 | β2 | 5 | 16 | β61 |
| β1 | β2 | β1 | 7 | 11 | β77 | |
| β1 | 1 | 8 | 4 | β88 | ||
| 2 | 7 | β4 | β92 | |||
| 5 | β11 | β88 | ||||
| β16 | β77 | |||||
| β61 |
Related sequences
Odd-indexed zigzag numbers, also called tangent numbers, are closely linked to Bernoulli numbers. This relationship is shown by a special math formula.
The Euler zigzag numbers are connected to Entringer numbers, which help calculate zigzag numbers. The Entringer numbers follow a specific pattern when built step by step.
Numbers with even positions are known as secant numbers or zig numbers. These appear in the Maclaurin series of the sec function. The first few values are 1, 1, 5, 61, 1385, 50521.
Numbers with odd positions are called tangent numbers or zag numbers. The first few values are 1, 2, 16, 272, 7936.
Explicit formula in terms of Stirling numbers of the second kind
Euler zigzag numbers connect to the Euler numbers and the Bernoulli numbers. This helps us understand a special formula.
The formula uses something called the rising factorial and a type of number known as Stirling numbers of the second kind. These tools help mathematicians study patterns in number arrangements.
Related articles
This article is a child-friendly adaptation of the Wikipedia article on Alternating permutation, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.
Safekipedia