decompwlj 3D

How it works: weight × level + jump

Take a strictly increasing sequence of whole numbers — the primes, the squares, any sequence of the OEIS. Each term, together with the next one, is written as a product plus a jump:

a(n) = k(n) · L(n) + d(n)

k is the weight, L the level and d the jump. Every term that can be decomposed is decomposed in exactly one way, by three steps.

The three steps

  1. The jump. d = a(n+1) − a(n), the distance to the next term.
  2. What is left. l = a(n) − d. The term decomposes only if l > d, that is a(n) > 2d; otherwise the jump is too large and the term is skipped.
  3. Weight and level. The weight k is the smallest divisor of l that is larger than d, and the level is L = l / k. Then a(n) = k·L + d, and k > d: the weight always exceeds the jump.

Three primes, worked by hand

113

next prime 127, so d = 14
l = 113 − 14 = 99
divisors of 99: 1, 3, 9, 11, 33, 99
the smallest above 14 is k = 33, and L = 99 / 33 = 3

113 = 33 × 3 + 14 · level class, k > L

1009

next prime 1013, so d = 4
l = 1009 − 4 = 1005
divisors of 1005: 1, 3, 5, 15, 67, …
the smallest above 4 is k = 5, and L = 1005 / 5 = 201

1009 = 5 × 201 + 4 · weight class, k ≤ L

7

next prime 11, so d = 4
l = 7 − 4 = 3
3 is not larger than 4: no divisor of 3 can exceed the jump

7 does not decompose (7 ≤ 2 × 4)

A term is in the level class when k > L and in the weight class when k ≤ L; the ties k = L sit on the diagonal. For the primes the weight is never even, and a prime above 3 is the lesser of a twin pair exactly when its weight is 3.

A little theory

A Euclidean division

Since the weight exceeds the jump, 0 ≤ d < k, and a = k·L + d is exactly the Euclidean division of a by k: the level L is the quotient and the jump d is the remainder. So the weight can be read another way: k is the smallest number above d for which dividing a by k leaves the remainder d, the distance to the next term. For 113: dividing by 15, 16, …, 32 leaves other remainders; 113 = 33 × 3 + 14 is the first division by a number above 14 whose remainder is 14. It is the same condition as before, since a leaves the remainder d on division by k exactly when k divides a − d.

When a term decomposes

If a > 2d, then l = a − d > d, and l is itself a divisor of l larger than d: a weight always exists and is unique, with d < k ≤ l. If a ≤ 2d, then l ≤ d and no divisor of l can exceed d: the term does not decompose. In other words a term decomposes unless the next term is at least 1.5 times as large, which only fast-growing sequences do all the time: the powers of 2, or the Fibonacci numbers, whose ratio tends to 1.618.

Weight or level: the window (d, √l]

Because k·L = l, the weight class k ≤ L is the same as k ≤ √l. A term is therefore in the weight class exactly when l has a divisor in the window d < k ≤ √l, and in the level class when that window holds no divisor of l. Three consequences:

The natural numbers and the sieve of Eratosthenes

For the natural numbers the jump is always d = 1, so the weight of a is the least divisor of a − 1 above 1: its smallest prime factor. That is what the sieve of Eratosthenes computes: it crosses out every composite number first with its smallest prime factor. The weight–level plate of the naturals is the sieve drawn in the plane: one column k = p for each prime p, holding the terms a for which p is the smallest prime factor of a − 1.

al = a − 1k, smallest prime factor of lLk × L + dclass
32212 × 1 + 1level
43313 × 1 + 1level
54222 × 2 + 1weight, tie
65515 × 1 + 1level
76232 × 3 + 1weight
87717 × 1 + 1level
98242 × 4 + 1weight
109333 × 3 + 1weight, tie
1110252 × 5 + 1weight
121111111 × 1 + 1level
1312262 × 6 + 1weight
141313113 × 1 + 1level
1514272 × 7 + 1weight
1615353 × 5 + 1weight
1716282 × 8 + 1weight

The window (1, √l] contains a divisor of l exactly when l is composite, so the level class of the naturals is the set of terms with a − 1 prime, all on the line L = 1: 9,592 of the first 10⁵ terms, one per prime below 10⁵. The ties are the squares of primes, a − 1 = p² (65 of them). For any other sequence the jump plays the role of a starting point: the divisors up to d are skipped, as if the sieve began at d + 1.

Try it

Type or paste increasing terms, or start from a sequence below. The table and the plate follow as you type.

The example's plate: weight k across, level L up, on log scales; the dashed line is k = L. Hover a point for its values.

na(n)dl = a − dkLk × L + dclass

Fibonacci is a sequence where nothing decomposes: each term is less than twice the jump to the next.

Reading the site

The decomposition is described in arXiv:0711.0865 and on decompwlj.com.