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-1 of 1 results.

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

Original entry on oeis.org

1, 2, 4, 3, 5, 7, 11, 13, 8, 10, 6, 14, 16, 20, 22, 12, 32, 34, 38, 40, 9, 23, 25, 29, 31, 17, 19, 15, 41, 43, 47, 49, 21, 59, 61, 65, 67, 35, 37, 33, 95, 97, 101, 103, 39, 113, 115, 119, 121, 26, 28, 24, 68, 70, 74, 76, 30, 86, 88, 92, 94, 18, 50, 52, 56
Offset: 1

Views

Author

Clark Kimberling, Nov 30 2013

Keywords

Comments

Let S be the sequence (or tree) of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1, 3*x - 1, and 3*x + 1 are in S. Then S is a permutation of the positive integers. Deleting duplicates as they occur, the generations of S are given by g(1) = (1), g(2) = (2,4), g(3) = (3,5,7,11,13), etc. Concatenating these gives A232798. The position of n in S gives the inverse permutation of S, as in A232799.

Examples

			Each x begets x + 1, 3*x - 1 and 3*x + 1, but if any of these has already occurred it is deleted.  Thus, 1 begets (2,4); then 2 begets (3,5,7) and 4 begets (11,13), making g(3) = (3,5,7,11,13), etc.
		

Crossrefs

Programs

  • Mathematica
    x = {1}; Do[x = DeleteDuplicates[Flatten[Transpose[{x, x + 1, 3 x - 1, 3 x + 1}]]], {8}];  x (* A232798 *)
    y = Flatten[Table[Position[x, n], {n, 1, 100}]] (* A232799 *)
Showing 1-1 of 1 results.