Safekipedia

Alternating permutation

Adapted from Wikipedia Β· Discoverer experience

Mathematical numbers and text from an 18th-century book by Johann Bernoulli.

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

The zigzag numbers in Bernoulli (1742), Opera Omnia vol. 4, p. 105

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.

  1. 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.
  2. At the end of each row, repeat the last number.
  3. 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
11
221
2455
161614105
163246566161
27227225622417812261
1
01
βˆ’1βˆ’10
0βˆ’1βˆ’2βˆ’2
55420
0510141616
βˆ’61βˆ’61βˆ’56βˆ’46βˆ’32βˆ’160
11⁠1/2⁠0βˆ’β 1/4β βˆ’β 1/4β βˆ’β 1/8⁠
01⁠3/2⁠10βˆ’β 3/4⁠
βˆ’1βˆ’1⁠3/2⁠4⁠15/4⁠
0βˆ’5βˆ’β 15/2⁠1
55βˆ’β 51/2⁠
061
βˆ’61
110βˆ’20160
0βˆ’1βˆ’2216βˆ’16
βˆ’1βˆ’1414βˆ’32
0510βˆ’46
55βˆ’56
0βˆ’61
βˆ’61
122βˆ’4βˆ’1632272
10βˆ’6βˆ’1248240
βˆ’1βˆ’6βˆ’660192
βˆ’506632
56666
610
βˆ’61
122⁠3/2⁠1⁠3/4⁠⁠3/4⁠
βˆ’10⁠3/2⁠2⁠5/4⁠0
βˆ’1βˆ’3βˆ’β 3/2⁠3⁠25/4⁠
2βˆ’3βˆ’β 27/2β βˆ’13
521βˆ’β 3/2⁠
βˆ’1645
βˆ’61
0βˆ’1βˆ’125βˆ’16βˆ’61
βˆ’1033βˆ’21βˆ’45
130βˆ’24βˆ’24
2βˆ’3βˆ’240
βˆ’5βˆ’2124
βˆ’1645
βˆ’61
21βˆ’1βˆ’2516βˆ’61
βˆ’1βˆ’2βˆ’1711βˆ’77
βˆ’1184βˆ’88
27βˆ’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.