Algorithms for complementary sequences
Abstract
Finding the n-th positive square number is easy, as it is simply n2. But how do we find the complementary sequence, i.e., the n-th positive non-square number? For this case there is an explicit formula. However, for general constraints on numbers, a formula is harder to find. In this paper, we study how to compute the n-th integer that does (or does not) satisfy a certain condition. In particular, we consider it as a fixed point problem, relate it to the iterative method of Lambek and Moser, study a bisection approach to this problem, and provide novel formulas for various complementary sequences including the non-k-gonal numbers, non-k-gonal-pyramidal numbers, non-k-simplex numbers, non-sum-of-k-th-powers, and non-k-th-powers. For example, we show that the n-th non k-gonal number is given by n+round(2n-2+k+14k-2) and that the n-th non-second-hexagonal number is n+n2-1.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.