This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A226137 #10 Jan 18 2022 03:36:47 %S A226137 1,2,3,4,6,7,10,14,15,22,32,46,47,69,101,147,148,217,318,465,466,683, %T A226137 1001,1466,1467,2150,3151,4617,4618,6768,9919,14536,14537,21305,31224, %U A226137 45760,45761,67066,98290,144050,144051,211117,309407,453457,453458 %N A226137 Positions of the integers in the ordering of rational numbers as generated by the rules: 1 is in S, and if nonzero x is in S, then x+1 and -1/x are in S. (See Comments.) %C A226137 Let S be the set of numbers defined by these rules: 1 is in S, and if nonzero x is in S, then x + 1 and -1/x are in S. Then S is the set of all rational numbers, produced in generations as follows: g(1) = (1), g(2) = (2, -1), g(3) = (3, -1/2, 0), g(4) = (4, -1/3, 1/2), ... For n > 4, once g(n-1) = (c(1), ..., c(z)) is defined, g(n) is formed from the vector (c(1)+1, -1/c(1), c(2)+1, -1/c(2), ..., c(z)+1, -1/c(z)) by deleting previously generated elements. Let S' denote the sequence formed by concatenating the generations. %C A226137 A226130: Denominators of terms of S' %C A226137 A226131: Numerators of terms of S' %C A226137 A226136: Positions of positive integers in S' %C A226137 A226137: Positions of integers in S' %H A226137 Clark Kimberling, <a href="/A226137/b226137.txt">Table of n, a(n) for n = 1..48</a> %e A226137 S'= (1/1, 2/1, -1/1, 3/1, -1/2, 0/1, 4/1, -1/3, 1/2, ...), with integers appearing in positions 1,2,3,4,6,7,... %t A226137 g[1] := {1}; z = 20; g[n_] := g[n] = DeleteCases[Flatten[Transpose[{# + 1, -1/#}]]&[DeleteCases[g[n - 1], 0]], Apply[Alternatives, Flatten[Map[g, Range[n - 1]]]]]; Flatten[Map[g, Range[7]]] (* ordered rationals *) %t A226137 Map[g, Range[z]]; Table[Length[g[i]], {i, 1, z}] (* cf A003410 *) %t A226137 f = Flatten[Map[g, Range[z]]]; %t A226137 Take[Denominator[f], 100] (* A226130 *) %t A226137 Take[Numerator[f], 100] (* A226131 *) %t A226137 p1 = Flatten[Table[Position[f, n], {n, 1, z}]] (* A226136 *) %t A226137 p2 = Flatten[Table[Position[f, -n], {n, 0, z}]]; %t A226137 Union[p1, p2] (* A226137 *) (* _Peter J. C. Moses_, May 26 2013 *) %Y A226137 Cf. A226080 (rabbit ordering of positive rationals). %K A226137 nonn %O A226137 1,2 %A A226137 _Clark Kimberling_, May 28 2013