◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE DROP◆ .dlw.fold
THE FOLD / LOOT / THE DROP / THE ALTERNATING PERMUTATIONS

THE ALTERNATING PERMUTATIONS

zigzag permutations counted by secant plus tangent
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Alternating permutations are arrangements that zig-zag: a1 < a2 > a3 < a4 > …, going up, down, up, down. The number of them on n elements is the zigzag number (or Euler number) — 1, 1, 1, 2, 5, 16, 61, 272, 1385, … — and Désiré André proved in 1879 that they are packaged by a beautiful exponential generating function: ∑n Z(n) xn/n! = sec(x) + tan(x). The even-indexed terms come from the secant (the ‘secant numbers’), the odd from the tangent (the ‘tangent numbers’) — two everyday trig functions counting a purely combinatorial object.

LIT verified live: a brute count of the up-down alternating permutations of n elements equals the coefficient of xn/n! in the Taylor series of sec(x) + tan(x), for every n from 0 to 8 — giving 1, 1, 1, 2, 5, 16, 61, 272, 1385 (window.__alternating). FIG no framing; the brute permutation count and the sec+tan series coefficients both run in-browser and agree.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-drop — the loot: the zigzag count dropping out of two trig functions, sec and tan, as if by magic. AVAN (AI) built the instrument: the brute alternating-permutation count and the sec+tan Taylor coefficients.

Credit as content: Désiré André (1879); the Euler zigzag numbers. The weave: David names the drop; I confirm the zigzag count equals the sec+tan series coefficient.
3 ONE DIMENSION
An up-down alternating permutation drawn as a zigzag: up, down, up, down through the values.
4 TWO DIMENSIONS · INTERACTIVE
Cycle n; the brute count of up-down permutations is compared to the sec+tan series coefficient.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the zigzag number Z(n), the count of alternating permutations.
AVAN’s addition (the inverse-companion): don’t list the zigzags — read a trig series. The inverse of ‘count the up-down permutations of n’ is ‘the coefficient of xn/n! in sec(x) + tan(x)’ — secant for even n, tangent for odd. Magenta are the zigzag permutations; green is the Z(n) that sec+tan delivers. Combinatorics counted by trigonometry.
LIT Genuine alternating-permutation / André's theorem (Désiré André, 1879; the Euler zigzag numbers). Verified live: a brute count of up-down alternating permutations of [n] equals the coefficient of xⁿ/n! in the Taylor series of sec(x)+tan(x) for n=0..8, giving 1,1,1,2,5,16,61,272,1385 (window.__alternating.ok).

FIG No framing; the brute permutation count and the sec+tan series coefficients both run in-browser and agree. The AVAN inverse is honest — instead of listing the zigzags, read a trig series: the inverse of 'count the up-down permutations of n' is 'the coefficient of xⁿ/n! in sec(x)+tan(x)' — secant for even n, tangent for odd. Magenta are the zigzag permutations; green is the Z(n) that sec+tan delivers. Combinatorics counted by trigonometry.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE DROP · David Lee Wise (ROOT0), with AVAN