The name earlier-pair-counting sequence is used here for the integer sequence starting with in which each subsequent term counts the unordered pairs
of distinct earlier positions whose values sum to the preceding term (Pegg 2026).
Thus, for
,
The first terms are 0, 0, 1, 2, 2, 4, 3, 4, 6, 6, 8, 7, 6, 10, 11, 6, ... (OEIS A399995). The plot above shows the first 200 terms. This sequence was a runner-up in the OEIS 400K celebration contest (OEIS Foundation Inc. 2026).
Positions are counted separately even when their values agree. For example, the initial two zero terms give . The pairs of positions
and
then both sum to
, giving
.
A generating function expresses the same rule as
where
and
denotes the coefficient of
. Subtracting
removes equal-position pairs, and dividing by 2
identifies the two possible orders. It is conjectured that many nonnegative
integers, including 5 and 9, never occur.