%I #8 Nov 17 2024 06:31:41
%S 0,1,1,2,1,3,2,3,2,4,2,5,2,5,3,5,4,5,4,5,5,5,6,5,6,5,6,6,6,7,6,7,6,7,
%T 7,7,7,8,7,8,7,8,8,8,8,8,9,8,9,8,9,9,9,9,9,10,9,10,9,10,10,10,10,10,
%U 10,11,10,11,10,11,11,11,11,11,11,11,12,11,12
%N Lexicographically earliest sequence of nonnegative integers a(0), a(1), ..., such that a(n) is the number of pairs of adjacent terms whose sum is n.
%H Rémy Sigrist, <a href="/A378117/b378117.txt">Table of n, a(n) for n = 0..10032</a>
%H Rémy Sigrist, <a href="/A378117/a378117.png">Colored scatterplot of the first 65000 terms</a> (where the color denotes the parity of n)
%H Rémy Sigrist, <a href="/A378117/a378117.txt">C++ program</a>
%e We can take a(0) = 0.
%e We cannot take a(1) = 0 as there are no pairs of consecutive terms summing to 0.
%e We can take a(1) = 1.
%e We cannot take a(2) = 0 as we already have one pair of consecutive terms summing to 1.
%e We can take a(2) = 1.
%e We cannot take a(3) = 0 as we already have one pair of consecutive terms summing to 1.
%e We cannot take a(3) = 1 as we already have one pair of consecutive terms summing to 2.
%e We can take a(3) = 2.
%o (C++) // See Links section.
%Y Cf. A001462, A307707.
%K nonn
%O 0,4
%A _Rémy Sigrist_ and _N. J. A. Sloane_, Nov 17 2024