Mathwords logoMathwords

Tangent Number — Definition, Formula & Example

A tangent number is one of the whole numbers 1, 2, 16, 272, 7936, ... that appear when you write the Taylor series of tan⁡x\tan x with factorials in the denominators. Each one also counts the zigzag arrangements of an odd number of distinct objects.

For n≥1n \ge 1, the tangent number T2n−1T_{2n-1} is (2n−1)!(2n-1)! times the coefficient of x2n−1x^{2n-1} in the Maclaurin series of tan⁡x\tan x. Equivalently, T2n−1T_{2n-1} is the number of permutations σ\sigma of {1,2,…,2n−1}\{1, 2, \dots, 2n-1\} that satisfy σ1<σ2>σ3<⋯>σ2n−1\sigma_1 < \sigma_2 > \sigma_3 < \cdots > \sigma_{2n-1}. These are called alternating permutations. Tangent numbers are the odd-indexed Euler zigzag numbers EkE_k, defined by sec⁡x+tan⁡x=∑k≥0Ekxkk!\sec x + \tan x = \sum_{k \ge 0} E_k \frac{x^k}{k!}. The even-indexed zigzag numbers are the secant numbers. Because of this, tangent numbers are also called zag numbers.

Key Formula

tan⁡x=∑n=1∞T2n−1 x2n−1(2n−1)!,T2n−1=(−1)n−1 22n(22n−1)2n B2n\tan x = \sum_{n=1}^{\infty} T_{2n-1}\,\frac{x^{2n-1}}{(2n-1)!}, \qquad T_{2n-1} = \frac{(-1)^{n-1}\,2^{2n}\left(2^{2n}-1\right)}{2n}\,B_{2n}
Where:
  • T2n−1T_{2n-1} = The tangent number with odd index 2n − 1 (a positive integer)
  • nn = A positive integer, n = 1, 2, 3, ...
  • B2nB_{2n} = The Bernoulli number with even index 2n
  • xx = The input to tan x, measured in radians, with |x| < π/2

Worked Example

Problem: The Maclaurin series of tan⁡x\tan x begins x+x33+2x515+17x7315+⋯x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17x^7}{315} + \cdots. Find the tangent numbers T3T_3, T5T_5, and T7T_7.
Step 1: Multiply the coefficient of x3x^3 by 3!3!. The result says there are 2 zigzag orderings of three objects: 132 and 231.
T3=3!⋅13=6⋅13=2T_3 = 3! \cdot \frac{1}{3} = 6 \cdot \frac{1}{3} = 2
Step 2: Multiply the coefficient of x5x^5 by 5!5!. Check it with the Bernoulli formula using n=3n = 3 and B6=142B_6 = \tfrac{1}{42}: 64⋅636⋅142=16\frac{64 \cdot 63}{6} \cdot \frac{1}{42} = 16.
T5=5!⋅215=120⋅215=16T_5 = 5! \cdot \frac{2}{15} = 120 \cdot \frac{2}{15} = 16
Step 3: Multiply the coefficient of x7x^7 by 7!7!.
T7=7!⋅17315=5040⋅17315=16⋅17=272T_7 = 7! \cdot \frac{17}{315} = 5040 \cdot \frac{17}{315} = 16 \cdot 17 = 272
Answer: T3=2T_3 = 2, T5=16T_5 = 16, and T7=272T_7 = 272. For example, exactly 16 of the 120 orderings of {1,2,3,4,5}\{1,2,3,4,5\} alternate up, down, up, down.

Why It Matters

Tangent numbers connect calculus, where they appear in the Taylor series of tan x, to counting, where they count alternating permutations. They also differ from Bernoulli numbers in a useful way. Bernoulli numbers are fractions, and most odd-indexed ones are zero. Tangent numbers are positive integers that carry the same information. For that reason, algorithms such as Knuth and Buckholtz's 1967 method compute tangent numbers with whole-number arithmetic and then convert them to Bernoulli numbers.

Common Mistakes

Mistake: Mixing up index conventions. For example, you read 'T3=16T_3 = 16' in one source and 'T3=2T_3 = 2' in another.
Correction: Some sources index by the odd power of xx (T1,T3,T5=1,2,16T_1, T_3, T_5 = 1, 2, 16). Others count consecutively (T1,T2,T3=1,2,16T_1, T_2, T_3 = 1, 2, 16). Check which convention your source uses before you apply a formula.

Related Terms

  • Bernoulli Number — Rational sequence that converts to tangent numbers by formula
  • Combinatorics — Field where tangent numbers count zigzag permutations
  • Permutation — Counts all orderings; tangent numbers count only alternating ones
  • Bell Number — Another integer sequence defined by an exponential generating function
  • Ménage Problem — Another count of permutations under adjacency restrictions
  • Taylor Series — Tangent numbers appear as coefficients in this expansion of tan x