TOPICS
Search

Earlier-Pair-Counting Sequence


EarlierPairCountingSequence

The name earlier-pair-counting sequence is used here for the integer sequence starting with a(1)=0 in which each subsequent term counts the unordered pairs of distinct earlier positions whose values sum to the preceding term (Pegg 2026). Thus, for n>=2,

 a(n)=|{(i,j):1<=i<j<n, a(i)+a(j)=a(n-1)}|.

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 a(3)=1. The pairs of positions (1,3) and (2,3) then both sum to a(3)=1, giving a(4)=2.

A generating function expresses the same rule as

 a(n)=[x^(a(n-1))](G_(n-1)(x)^2-G_(n-1)(x^2))/2,

where G_(n-1)(x)=sum_(i=1)^(n-1)x^(a(i)) and [x^m] denotes the coefficient of x^m. Subtracting G_(n-1)(x^2) 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.


See also

Integer Sequence

Explore with Wolfram|Alpha

References

OEIS Foundation Inc. "A400K Winners." 2026. https://oeis.org/wiki/A400K_Winners. Pegg, E. Jr. "Winners of the OEIS 400K Milestone Contest." Wolfram Community. Oct. 26, 2026. https://community.wolfram.com/t/28423.Sloane, N. J. A. Sequence A399995 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Earlier-Pair-Counting Sequence." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Earlier-Pair-CountingSequence.html

Subject classifications