%I #32 Jul 11 2019 02:57:11
%S 1,0,2,0,2,1,3,0,3,1,3,2,4,0,4,1,4,2,4,3,5,0,5,1,5,2,5,3,5,4,6,0,6,1,
%T 6,2,6,3,6,4,6,5,7,0,7,1,7,2,7,3,7,4,7,5,7,6,8,0,8,1,8,2,8,3,8,4,8,5,
%U 8,6,8,7,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,11,0,11,1,11,2,11,3,11,4
%N Write n = C(i,2)+C(j,1) with i>j>=0; let L[n] = [i,j]; sequence gives list of pairs L[n], n >= 0.
%C Each n >= 0 has a unique representation as n = C(i,2)+C(j,1) with i>j>=0. This is the combinatorial number system of degree t = 2. The i values are A002024, the j values A002262.
%D D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.
%e The pairs L[0] through L[10] are
%e [1, 0]
%e [2, 0]
%e [2, 1]
%e [3, 0]
%e [3, 1]
%e [3, 2]
%e [4, 0]
%e [4, 1]
%e [4, 2]
%e [4, 3]
%e [5, 0]
%t A138036list[len_] := Module[{i = 0, j = 1, L = {1, 0}}, Do[i++; If[i == j, j++; i = 0]; AppendTo[L, j]; AppendTo[L, i], {len}]; L];
%t A138036list[60] (* _Jean-François Alcover_, Jul 11 2019, after _Peter Luschny_ *)
%o (Sage)
%o def A138036_list(len):
%o i, j = 0, 1
%o L = [1, 0]
%o for _ in range(len):
%o i += 1
%o if i == j:
%o j += 1
%o i = 0
%o L.append(j)
%o L.append(i)
%o return L
%o A138036_list(47) # _Peter Luschny_, May 18 2015
%Y Cf. A002024, A002262. See A194847 for degree t=3.
%K nonn,tabf
%O 0,3
%A _N. J. A. Sloane_, Sep 04 2011