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

A233135 Shortest (x+1,2x)-code of n.

Original entry on oeis.org

1, 2, 21, 22, 221, 212, 2121, 222, 2221, 2212, 22121, 2122, 21221, 21212, 212121, 2222, 22221, 22212, 222121, 22122, 221221, 221212, 2212121, 21222, 212221, 212212, 2122121, 212122, 2121221, 2121212, 21212121, 22222, 222221, 222212, 2222121, 222122, 2221221
Offset: 1

Views

Author

Clark Kimberling, Dec 05 2013

Keywords

Comments

Every positive integer is a composite of f(x) = x + 1 and g(x) = 2*x starting with x = 1. For example, 5 = f(g(g(1))), which abbreviates as fgg, or 122, which we call a (x+1,2x)-code of 5. It appears that the number of (x+1,2x)-codes of n is A040039(n), that these numbers form Guy Steele's sequence GS(4,5) at A135529, and that for k >= 1, then number of such codes is F(n-1), where F = A000045, the Fibonacci numbers. See A232559 for the uncoded positive integers in the order generated by the rules x -> x+1 and x -> 2*x.

Crossrefs

Programs

  • Mathematica
    b[x_] := b[x] = If[OddQ[x], x - 1, x/2]; u[n_] := 2 - Mod[Drop[FixedPointList[b, n], -3], 2]; u[1] = {1}; t = Table[u[n], {n, 1, 30}]; Table[FromDigits[u[n]], {n, 1, 50}]  (* A233137 *)
    Flatten[t]  (* A233138 *)
    Table[FromDigits[Reverse[u[n]]], {n, 1, 30}]  (* A233135 *)
    Flatten[Table[Reverse[u[n]], {n, 1, 30}]]  (* A233136 *)

Formula

Define h(x) = x - 1 if x is odd and h(x) = x/2 if x is even, and define H(x,1) = h(x) and H(x,k) = H(H(x,k-1)). For each n > 1, the sequence (H(n,k)) decreases to 1 through two kinds of steps; write 1 when the step is x - 1 and write 2 when the step is x/2. Let c(n) be the concatenation of 1s and 2s; then A233135(n) is the reversal of c(n), as in the Mathematica program.

A233136 Concatenated shortest (x+1,2x)-codes for the positive integers.

Original entry on oeis.org

1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1
Offset: 1

Views

Author

Clark Kimberling, Dec 05 2013

Keywords

Comments

Concatenate the representations of the positive integers in A233135, and then separate the digits by commas, in the manner analogous to A030302.

Examples

			A233135 = (1,2,21,22,221,212,...), so that A233136 = (1,2,2,1,2,2,2,2,1,2,1,2,...).
		

Crossrefs

Programs

  • Mathematica
    b[x_] := b[x] = If[OddQ[x], x - 1, x/2]; u[n_] := 2 - Mod[Drop[FixedPointList[b, n], -3], 2]; u[1] = {1}; t = Table[u[n], {n, 1, 30}]; Table[FromDigits[u[n]], {n, 1, 50}]  (* A233137 *)
    Flatten[t]  (* A233138 *)
    Table[FromDigits[Reverse[u[n]]], {n, 1, 30}]  (* A233135 *)
    Flatten[Table[Reverse[u[n]], {n, 1, 30}]]  (* A233136 *)

A233138 Concatenated reversed shortest (x+1,2x)-codes for the positive integers.

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2
Offset: 1

Views

Author

Clark Kimberling, Dec 05 2013

Keywords

Comments

Concatenate the representations of the positive integers in A233137, and then separate the digits by commas.

Examples

			A233137 = (1,2,12,22,122,212,...), so that A233138 = (1,2,1,2,2,2,1,2,2,2,1,2,...)
		

Crossrefs

Programs

  • Mathematica
    b[x_] := b[x] = If[OddQ[x], x - 1, x/2]; u[n_] := 2 - Mod[Drop[FixedPointList[b, n], -3], 2]; u[1] = {1}; t = Table[u[n], {n, 1, 30}]; Table[FromDigits[u[n]], {n, 1, 50}]  (* A233137 *)
    Flatten[t]  (* A233138 *)
    Table[FromDigits[Reverse[u[n]]], {n, 1, 30}]  (* A233135 *)
    Flatten[Table[Reverse[u[n]], {n, 1, 30}]]     (* A233136 *)
Showing 1-3 of 3 results.