cp's OEIS Frontend

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.

Showing 1-7 of 7 results.

A226080 Denominators in the Fibonacci (or rabbit) ordering of the positive rational numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 1, 4, 3, 2, 3, 1, 5, 4, 3, 4, 2, 5, 3, 1, 6, 5, 4, 5, 3, 7, 4, 2, 7, 5, 3, 5, 1, 7, 6, 5, 6, 4, 9, 5, 3, 10, 7, 4, 7, 2, 9, 7, 5, 7, 3, 8, 5, 1, 8, 7, 6, 7, 5, 11, 6, 4, 13, 9, 5, 9, 3, 13, 10, 7, 10, 4, 11, 7, 2, 11, 9, 7, 9, 5, 12, 7
Offset: 1

Views

Author

Clark Kimberling, May 25 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x+1 and 1/x are in S. Then S is the set of positive rational numbers, which arise in generations as follows: g(1) = (1/1), g(2) = (1+1) = (2), g(3) = (2+1, 1/2) = (3/1, 1/2), g(4) = (4/1, 1/3, 3/2), ... . Once g(n-1) = (g(1), ..., g(z)) is defined, g(n) is formed from the vector (g(1) + 1, 1/g(1), g(2) + 1, 1/g(2), ..., g(z) + 1, 1/g(z)) by deleting all elements that are in a previous generation. A226080 is the sequence of denominators formed by concatenating the generations g(1), g(2), g(3), ... . It is easy to prove the following:
(1) Every positive rational is in S.
(2) The number of terms in g(n) is the n-th Fibonacci number, F(n) = A000045(n).
(3) For n > 2, g(n) consists of F(n-2) numbers < 1 and F(n-1) numbers > 1, hence the name "rabbit ordering" since the n-th generation has F(n-2) reproducing pairs and F(n-1) non-reproducing pairs, as in the classical rabbit-reproduction introduction to Fibonacci numbers.
(4) The positions of integers in S are the Fibonacci numbers.
(5) The positions of 1/2, 3/2, 5/2, ..., are Lucas numbers (A000032).
(6) Continuing from (4) and (5), suppose that n > 0 and 0 < r < n, where gcd(n,r) = 1. The positions in A226080 of the numbers congruent to r mod n comprise a row of the Wythoff array, W = A035513. The correspondence is sampled here:
row 1 of W: positions of n+1 for n>=0,
row 2 of W: positions of n+1/2,
row 3 of W: positions of n+1/3,
row 4 of W: positions of n+1/4,
row 5 of W: positions of n+2/3,
row 6 of W: positions of n+1/5,
row 7 of W: positions of n+3/4.
(7) If the numbers <=1 in S are replaced by 1 and those >1 by 0, the resulting sequence is the infinite Fibonacci word A003849 (except for the 0-offset first term).
(8) The numbers <=1 in S occupy positions -1 + A001950, where A001950 is the upper Wythoff sequence; those > 1 occupy positions given by -1 + A000201, where A000201 is the lower Wythoff sequence.
(9) The rules (1 is in S, and if x is in S, then 1/x and 1/(x+1) are in S) also generate all the positive rationals.
A variant which extends this idea to an ordering of all rationals is described in A226130. - M. F. Hasler, Jun 03 2013
The updown and downup zigzag limits are (-1 + sqrt(5))/2 and (1 + sqrt(5))/2; see A020651. - Clark Kimberling, Nov 10 2013
From Clark Kimberling, Jun 19 2014: (Start)
Following is a guide to related trees and sequences; for example, the tree A226080 is represented by (1, x+1, 1/x), meaning that 1 is in S, and if x is in S, then x+1 and 1/x are in S (except for x = 0).
All the positive integers:
A243571, A243572, A232559 (1, x+1, 2x)
A232561, A242365, A243572 (1, x+1, 3x)
A243573 (1, x+1, 4x)
All the integers:
A243610 (1, 2x, 1-x)
All the positive rationals:
A226080, A226081, A242359, A242360 (1, x+1, 1/x)
A243848, A243849, A243850 (1, x+1, 2/x)
A243851, A243852, A243853 (1, x+1, 3/x)
A243854, A243855, A243856 (1, x+1, 4/x)
A243574, A242308 (1, 1/x, 1/(x+1))
A241837, A243575 ({1,2,3}, x+4, 12/x)
A242361, A242363 (1, 1 + 1/x, 1/x)
A243613, A243614 (0, x+1, x/(x+1))
All the rationals:
A243611, A243612 (0, x+1, -1/(x+1))
A226130, A226131 (1, x+1, -1/x)
A243712, A243713 ({1,2,3}, x+1, 1/(x+1))
A243730, A243731 ({1,2,3,4}, x+1, 1/(x+1))
A243732, A243733 ({1,2,3,4,5}, x+1, 1/(x+1))
A243925, A243926, A243927 (1, x+1, -2/x)
A243928, A243929, A243930 (1, x+1, -3/x)
All the Gaussian integers:
A243924 (1, x+1, i*x)
All the Gaussian rational numbers:
A233694, A233695, A233696 (1, x+1, i*x, 1/x).
(End)

Examples

			The denominators are read from the rationals listed in "rabbit order":
1/1, 2/1, 3/1, 1/2, 4/1, 1/3, 3/2, 5/1, 1/4, 4/3, 5/2, 2/3, 6/1, ...
		

Crossrefs

Cf. A000045, A035513, A226081 (numerators), A226130, A226247, A020651.

Programs

  • Mathematica
    z = 10; g[1] = {1}; g[2] = {2}; g[3] = {3, 1/2};
    j[3] = Join[g[1], g[2], g[3]]; j[n_] := Join[j[n - 1], g[n]];
    d[s_List, t_List] := Part[s, Sort[Flatten[Map[Position[s, #] &, Complement[s, t]]]]]; j[3] = Join[g[1], g[2], g[3]]; n = 3; While[n <= z, n++; g[n] = d[Riffle[g[n - 1] + 1, 1/g[n - 1]], g[n - 2]]];
    Table[g[n], {n, 1, z}]; j[z] (* rabbit-ordered rationals *)
    Denominator[j[z]]  (* A226080 *)
    Numerator[j[z]]    (* A226081 *)
    Flatten[NestList[(# /. x_ /; x > 1 -> Sequence[x, 1/x - 1]) + 1 &, {1}, 9]] (* rabbit-ordered rationals, Danny Marmer, Dec 07 2014 *)
  • PARI
    A226080_vec(N=100)={my(T=[1],S=T,A=T); while(N>#A=concat(A, apply(denominator, T=select(t->!setsearch(S,t), concat(apply(t->[t+1,1/t],T))))), S=setunion(S,Set(T)));A} \\ M. F. Hasler, Nov 30 2018
    
  • PARI
    (A226080(n)=denominator(RabbitOrderedRational(n))); ROR=List(1); RabbitOrderedRational(n)={if(n>#ROR, local(S=Set(ROR), i=#ROR*2\/(sqrt(5)+1), a(t)=setsearch(S,t)||S=setunion(S,[listput(ROR,t)])); until( type(ROR[i+=1])=="t_INT" && n<=#ROR, a(ROR[i]+1); a(1/ROR[i])));ROR[n]} \\ M. F. Hasler, Nov 30 2018

A226130 Denominators 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.)

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 4, 3, 2, 1, 1, 5, 4, 3, 2, 2, 3, 1, 6, 5, 4, 3, 3, 5, 2, 5, 3, 1, 7, 6, 5, 4, 4, 7, 3, 8, 5, 2, 7, 5, 3, 1, 1, 8, 7, 6, 5, 5, 9, 4, 11, 7, 3, 11, 8, 5, 2, 2, 9, 7, 5, 3, 3, 4, 1, 9, 8, 7, 6, 6, 11, 5, 14, 9, 4, 15, 11, 7, 3, 3
Offset: 1

Views

Author

Clark Kimberling, May 28 2013

Keywords

Comments

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.
A226130: Denominators of terms of S'
A226131: Numerators of terms of S'
A226136: Positions of positive integers in S'
A226137: Positions of integers in S'
The length of row n is given by A226275(n-1). - Peter Kagey, Jan 17 2022

Examples

			The denominators and numerators are read from the rationals in S':
  1/1, 2/1, -1/1, 3/1, -1/2, 0/1, 4/1, -1/3, 1/2, ...
Table begins:
  n |
  --+-----------------------------------------------
  1 | 1;
  2 | 1, 1;
  3 | 1, 2, 1;
  4 | 1, 3, 2;
  5 | 1, 4, 3, 2, 1;
  6 | 1, 5, 4, 3, 2, 2, 3;
  7 | 1, 6, 5, 4, 3, 3, 5, 2, 5, 3;
  8 | 1, 7, 6, 5, 4, 4, 7, 3, 8, 5, 2, 7, 5, 3, 1;
		

Crossrefs

Cf. A226080 (rabbit ordering of positive rationals).
Cf. A226247 (analogous with "0 is in S").

Programs

  • Mathematica
    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 *)
    Map[g, Range[z]]; Table[Length[g[i]], {i, 1, z}] (* cf. A003410 *)
    f = Flatten[Map[g, Range[z]]];
    Take[Denominator[f], 100] (* A226130 *)
    Take[Numerator[f], 100]   (* A226131 *)
    p1 = Flatten[Table[Position[f, n], {n, 1, z}]] (* A226136 *)
    p2 = Flatten[Table[Position[f, -n], {n, 0, z}]];
    Union[p1, p2]  (* A226137 *)  (* Peter J. C. Moses, May 26 2013 *)
  • Python
    from fractions import Fraction
    from itertools import count, islice
    def agen():
        rats = [Fraction(1, 1)]
        seen = {Fraction(1, 1)}
        for n in count(1):
            yield from [r.denominator for r in rats]
            newrats = []
            for r in rats:
                f = 1+r
                if f not in seen:
                    newrats.append(1+r)
                    seen.add(f)
                if r != 0:
                    g = -1/r
                    if g not in seen:
                        newrats.append(-1/r)
                        seen.add(g)
            rats = newrats
    print(list(islice(agen(), 84))) # Michael S. Branicky, Jan 17 2022

A226136 Positions of the positive 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.)

Original entry on oeis.org

1, 2, 4, 7, 10, 15, 22, 32, 47, 69, 101, 148, 217, 318, 466, 683, 1001, 1467, 2150, 3151, 4618, 6768, 9919, 14537, 21305, 31224, 45761, 67066, 98290, 144051, 211117, 309407, 453458, 664575, 973982
Offset: 1

Views

Author

Clark Kimberling, May 28 2013

Keywords

Comments

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.
A226130: Denominators of terms of S'
A226131: Numerators of terms of S'
A226136: Positions of positive integers in S'
A226137: Positions of integers in S'

Examples

			S' = (1/1, 2/1, -1/1, 3/1, -1/2, 0/1, 4/1, -1/3, 1/2, ...), with positive integers appearing in positions 1,2,4,7,...
		

Crossrefs

Cf. A226080 (rabbit ordering of positive rationals).

Programs

  • Mathematica
    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 *)
    Map[g, Range[z]]; Table[Length[g[i]], {i, 1, z}] (* cf A003410 *)
    f = Flatten[Map[g, Range[z]]];
    Take[Denominator[f], 100] (* A226130 *)
    Take[Numerator[f], 100]   (* A226131 *)
    p1 = Flatten[Table[Position[f, n], {n, 1, z}]] (* A226136 *)
    p2 = Flatten[Table[Position[f, -n], {n, 0, z}]];
    Union[p1, p2]  (* A226137 *) (* Peter J. C. Moses, May 26 2013 *)

Formula

Conjecture: a(n) = a(n-1)+a(n-3) for n>6. G.f.: -x*(x+1) * (x^2+1)^2 / (x^3+x-1). - Colin Barker, Jul 03 2013

A232723 Sequence (or tree) generated by these rules: 0 is in S, and if x is in S, then 2*x and 1 - x are in S, and duplicates are deleted as they occur.

Original entry on oeis.org

0, 1, 2, 4, -1, 8, -3, -2, 16, -7, -6, -4, 3, 32, -15, -14, -12, 7, -8, 5, 6, 64, -31, -30, -28, 15, -24, 13, 14, -16, 9, 10, 12, -5, 128, -63, -62, -60, 31, -56, 29, 30, -48, 25, 26, 28, -13, -32, 17, 18, 20, -9, 24, -11, -10, 256, -127, -126, -124, 63
Offset: 1

Views

Author

Clark Kimberling, Nov 28 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 0 is in S, and if x is in S, then 2*x and 1 - x are in S. Then S is the set of integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (0), g(2) = (1), g(3) = (2), g(4) = (4,-1), g(5) = (8,-3,-2), etc. Concatenating these gives A232723. Every integer occurs exactly once in S. The even integers occupy the positions given by the lower Wythoff sequence, A000201; the odds, by the upper Wythoff sequence, A001950. The positive integers occupy the positions given by A189035, and the positions of the nonpositives, by A189034.
Inverse beginning with 0: 1, 2, 3, 13, 4, 20, 21, 18, 6, 31, 32, 89, 33, 28, 29, 26, 9, 49, 50, 136, 51, 143, 144, 141, 53, 44, ..., . - Robert G. Wilson v, Jun 17 2014

Examples

			Each x begets 2*x and 1 - x, and if either has already occurred it is deleted. Thus, 0 begets 1, which begets 2, which begets (4,-1), etc.
		

Crossrefs

Programs

  • Mathematica
    x = {0}; Do[x = DeleteDuplicates[Flatten[Transpose[{x, 2*x, 1 - x}]]], {10}]; x  (* Peter J. C. Moses, Nov 28 2013 *)
    Nest[ DeleteDuplicates[ Flatten[ # /. a_Integer -> {2a, 1-a}]]&, {0}, 9] (* Robert G. Wilson v, Jun 17 2014 *)

A243612 Irregular triangular array of numerators of all rational numbers ordered as in Comments.

Original entry on oeis.org

0, -1, 1, -1, 2, -2, -1, 1, 3, -3, -2, -1, 2, 3, 4, -3, -4, -3, -2, -1, 1, 3, 5, 5, 5, -5, -5, -5, -3, -4, -3, -2, -1, 2, 3, 4, 4, 7, 8, 7, 6, -4, -7, -8, -7, -6, -5, -5, -5, -3, -4, -3, -2, -1, 1, 3, 5, 5, 5, 7, 8, 9, 7, 11, 11, 9, 7, -7, -8, -9, -7, -11
Offset: 1

Views

Author

Clark Kimberling, Jun 08 2014

Keywords

Comments

Let F = A000045 (the Fibonacci numbers). Row n of the array to be generated consists of F(n-1) nonnegative rationals together with F(n-1) negative rationals. The nonnegatives, for n >=3, are x + 1 from the F(n-2) nonnegative numbers x in row n-1, together with x/(x + 1) from the F(n-3) nonnegative numbers x in row n-2. The negatives in row n are the negative reciprocals of the positives in row n.

Examples

			First 6 rows of the array of all rationals:
0/1
-1/1 .. 1/1
-1/2 .. 2/1
-2/1 .. -1/3 .. 1/2 ... 3/1
-3/2 .. -2/3 .. -1/4 .. 2/3 ... 3/2 ... 4/1
-3/1 .. -4/3 .. -3/5 .. -2/5 .. -1/5 .. 1/3 . 3/4 . 5/3 . 5/2 . 5/1
The numerators, by rows:  0,-1, 1, -1, 2, -2, -1, 1, 3, -3, -2, -1, 2, 3, 4, -2, -4, -3, -2, -1, 1,3,5,5,5,...
		

Crossrefs

Programs

  • Mathematica
    z = 12; g[1] = {0}; f1[x_] := x + 1; f2[x_] := -1/(x + 1); h[1] = g[1];
    b[n_] := b[n] = DeleteDuplicates[Union[f1[g[n - 1]], f2[g[n - 1]]]];
    h[n_] := h[n] = Union[h[n - 1], g[n - 1]];
    g[n_] := g[n] = Complement [b[n], Intersection[b[n], h[n]]]
    u = Table[g[n], {n, 1, z}]
    v = Table[Reverse[Drop[g[n], Fibonacci[n - 1]]], {n, 2, z}]
    Delete[Flatten[Denominator[u]], 6]  (* A243611 *)
    Delete[Flatten[Numerator[u]], 6]    (* A243612 *)
    Delete[Flatten[Denominator[v]], 2]  (* A243613 *)
    Delete[Flatten[Numerator[v]], 2]    (* A243614 *)
    ListPlot[g[20]]

A243715 Irregular triangular array of numerators of all rational numbers ordered as in Comments.

Original entry on oeis.org

1, -1, 2, -1, 0, 3, -1, 1, 4, -2, -1, 2, 3, 5, -3, -2, -1, 3, 5, 5, 6, -4, -3, -2, -1, 1, 4, 7, 8, 7, 7, -3, -5, -4, -3, -2, -1, 2, 3, 5, 4, 9, 11, 11, 9, 8, -5, -5, -6, -3, -5, -4, -3, -2, -1, 3, 5, 5, 6, 7, 8, 11, 7, 14, 15, 14, 11, 9, -7, -8, -7, -7, -5
Offset: 1

Views

Author

Clark Kimberling, Jun 09 2014

Keywords

Comments

Let W denote the array of all positive rational numbers defined at A243712. For the present array, put (row 1) = (1), (row 2) = (-1, 3), (row 3) = (-1/2,0,3), and (row 4) = (-1/3,1/2,4). Thereafter, (row n) consists of the following numbers in increasing order: (row n) of W together -1/x for each x in (row n-1) of W.

Examples

			First 6 rows of the array of all positive rationals:
1/1
-1/1 ... 2/1
-1/2 ... 0/1 ... 3/1
-1/3 ... 1/2 ... 4/1
-2/1 .... -1/4 ... 2/3 ... 3/2 ... 5/1
-3/2 ... -2/3 ... -1/5 ... 3/4 ... 5/3 ... 5/2 ... 6/1
The numerators, by rows: 1,-1,2,-1,0,3,-1,1,4,-2,-1,2,3,5,-3,-2,-1,3,5,6,,...
		

Crossrefs

Programs

  • Mathematica
    z = 13; g[1] = {1}; f1[x_] := x + 1; f2[x_] := -1/x; h[1] = g[1]; b[n_] := b[n] = DeleteDuplicates[Union[f1[g[n - 1]], f2[g[n - 1]]]];
    h[n_] := h[n] = Union[h[n - 1], g[n - 1]]; g[n_] := g[n] = Complement [b[n], Intersection[b[n], h[n]]]; u = Table[g[n], {n, 1, z}]; u1 = Delete[Flatten[u], 10]
    w[1] = 0; w[2] = 1; w[3] = 1; w[n_] := w[n - 1] + w[n - 3];
    u2 = Table[Drop[g[n], w[n]], {n, 1, z}];
    u3 = Delete[Delete[Flatten[Map[Reverse, u2]], 4], 4]
    Denominator[u3]  (* A243712 *)
    Numerator[u3]    (* A243713 *)
    Denominator[u1]  (* A243714 *)
    Numerator[u1]    (* A243715 *)

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.)

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 10, 14, 15, 22, 32, 46, 47, 69, 101, 147, 148, 217, 318, 465, 466, 683, 1001, 1466, 1467, 2150, 3151, 4617, 4618, 6768, 9919, 14536, 14537, 21305, 31224, 45760, 45761, 67066, 98290, 144050, 144051, 211117, 309407, 453457, 453458
Offset: 1

Views

Author

Clark Kimberling, May 28 2013

Keywords

Comments

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.
A226130: Denominators of terms of S'
A226131: Numerators of terms of S'
A226136: Positions of positive integers in S'
A226137: Positions of integers in S'

Examples

			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,...
		

Crossrefs

Cf. A226080 (rabbit ordering of positive rationals).

Programs

  • Mathematica
    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 *)
    Map[g, Range[z]]; Table[Length[g[i]], {i, 1, z}] (* cf A003410 *)
    f = Flatten[Map[g, Range[z]]];
    Take[Denominator[f], 100] (* A226130 *)
    Take[Numerator[f], 100]   (* A226131 *)
    p1 = Flatten[Table[Position[f, n], {n, 1, z}]] (* A226136 *)
    p2 = Flatten[Table[Position[f, -n], {n, 0, z}]];
    Union[p1, p2]  (* A226137 *)  (* Peter J. C. Moses, May 26 2013 *)
Showing 1-7 of 7 results.