OFFSET
0,3
COMMENTS
REFERENCES
D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.
EXAMPLE
The pairs L[0] through L[10] are
[1, 0]
[2, 0]
[2, 1]
[3, 0]
[3, 1]
[3, 2]
[4, 0]
[4, 1]
[4, 2]
[4, 3]
[5, 0]
MATHEMATICA
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];
A138036list[60] (* Jean-François Alcover, Jul 11 2019, after Peter Luschny *)
PROG
(Sage)
def A138036_list(len):
i, j = 0, 1
L = [1, 0]
for _ in range(len):
i += 1
if i == j:
j += 1
i = 0
L.append(j)
L.append(i)
return L
A138036_list(47) # Peter Luschny, May 18 2015
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
N. J. A. Sloane, Sep 04 2011
STATUS
approved