Proof that every number appears in A307720 N. J. A. Sloane October 5 2021 A307720 is defined to be the lexicographically earliest sequence of positive integers in which, for all positive k, there are exactly k pairs of consecutive terms whose product is k. Let a = { a(n): n >= 1 } denote this sequence. The definition is tricky, because we have to consider what will happen in the infinite future. So let us define a sequence A = { A(n): n >= 1 } by the greedy algorithm: A(n) is the smallest k such that A(n-1)*k does not violate the rule that in the sequence B = { B(n): n >= 1 } = { A(i)*A(i+1): i >= 1} no number m appears more than m times. This is well-defined: A(n) is the smallest number k such that in the list [ A(1)*A(2), A(2)*A(3), ... A(n-2)*A(n-1), A(n-1)*k ] the number A(n-1)*k does not appear more than A(n-1)*k times. Note that max( A(i)^2, i=1..n-1 ) is always a candidate for k. We will prove that a = A. Let p be a prime. If A(n) is the first term that is divisible by p, then A(n) is actually equal to p. (Since no term in B up to this point is divisible by p, there is no obstruction to taking A(n) = p.) Furthermore the primes p appear in increasing order. Let w(m) be the index of the last m in B, if m appears in B. If m never appears in B, set w(m) = -1. Let W(m) = maximum of w(i) for i <= m. Obviously if n > W(m), then B(n) > m. Every prime p must appear in A. For if not then all terms in A are products of primes less than p. Consider A(n) for n = W(p) + 1. Then A(n) > p. But p would be a smaller candidate for A(n). Contradiction. The first time a prime p appears in A it has a 1 either mmediately before it or mmediately after it. (We either see ..., 1, p, .... in A or ...., q>1, p, 1, ... ,) Since every prime appears in A, there are infinitely many 1's in A. After a 1 appears in A, the next term is (by definition) the smallest number k which has not yet appeared k times in B. So eventually every number must appear in A. Now let's go back and look at the original sequence a. The sequence a can't be lexicographically earlier than A (if it was, look at the first place where they differ, and we get a contradiction). So a = A. So every number appears in a. QED Essentially the same argument shows that each number k appears exactly k times in the sequence of products A(i)*A(i+1) and therefore in the sequence of products a(i)*a(i+1).