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.

Previous Showing 21-30 of 41 results. Next

A290536 Let S be the sequence generated by these rules: 0 is in S, and if z is in S, then z + 1 and z * (1+i) are in S (where i denotes the imaginary unit), and duplicates are deleted as they occur; a(n) = the real part of the n-th term of S.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 05 2017

Keywords

Comments

See A290537 for the imaginary part of the n-th term of S.
See A290538 for the square of the norm of the n-th term of S.
The representation of the first terms of S in the complex plane has nice fractal features (see also Links section).
The sequence S is a "complex" variant of A232559.
The sequence S is a permutation of the Gaussian integers (Z[i]):
- let u be the function defined over Z[i] by z -> z+1,
- let v be the function defined over Z[i] by z -> z*(1+i),
- for m, n, o, p and q >= 0,
let f(m,n,o,p,q) = u^m(v(u^n(v(u^o(v(v(u^p(v(v(u^q(0)))))))))))
(where w^k denotes the k-th iterate of w),
- f(m,0,0,0,0) = m, and any nonnegative integer x can be represented in this way for some m >= 0,
- f(m,n,0,0,0) = m+n + n*i, and any Gaussian integer x+y*i with 0 <= x and 0 <= y <= x can be represented in this way for some m and n >= 0,
- f(m,n,o,0,0) = f(m,n,0,0,0) + 2*o*i, and any Gaussian integer x+y*i with 0 < x and 0 <= y can be represented in this way for some m, n and o >= 0,
- f(m,n,o,p,0) = f(m,n,o,0,0) - 4*p, and any Gaussian integer x+y*i with 0 <= y can be represented in this way for some m, n, o and p >= 0,
- f(m,n,o,p,q) = f(m,n,o,p,0) - 8*q*i, and any Gaussian integer x+y*i can be represented in this way for some m, n, o, p and q >= 0,
- in other words, any Gaussian integer can be reached from 0 after a finite number of steps chosen in { u, v }, QED.

Examples

			S(1) = 0 by definition; so a(1) = 0.
S(1)+1 = 1 has not yet occurred; so S(2) = 1 and a(2) = 1.
S(1)*(i+i) = 0 has already occurred.
S(2)+1 = 2 has not yet occurred; so S(3) = 2 and a(3) = 2.
S(2)*(1+i) = 1+i has not yet occurred; so S(4) = 1+i and a(4) = 1.
S(3)+1 = 3 has not yet occurred; so S(5) = 3 and a(5) = 3.
		

Crossrefs

Programs

  • PARI
    See Links section.

A385887 The number k such that the k-th composition in standard order is the reversed sequence of lengths of maximal runs of binary indices of n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 4, 1, 3, 3, 6, 2, 5, 4, 8, 1, 3, 3, 6, 3, 7, 6, 12, 2, 5, 5, 10, 4, 9, 8, 16, 1, 3, 3, 6, 3, 7, 6, 12, 3, 7, 7, 14, 6, 13, 12, 24, 2, 5, 5, 10, 5, 11, 10, 20, 4, 9, 9, 18, 8, 17, 16, 32, 1, 3, 3, 6, 3, 7, 6, 12, 3, 7, 7, 14, 6, 13, 12, 24
Offset: 0

Views

Author

Gus Wiseman, Jul 17 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The binary indices of 100 are {3,6,7}, with maximal runs ((3),(6,7)), with reversed lengths (2,1), which is the 5th composition in standard order, so a(100) = 5.
		

Crossrefs

Removing duplicates appears to give A232559, see also A348366, A358654, A385818.
Sorted positions of firsts appearances appear to be A247648+1.
The non-reverse version is A385889.
A245563 lists run-lengths of binary indices (ranks A246029), reverse A245562.
A384877 lists anti-run lengths of binary indices (ranks A385816), reverse A209859.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    Table[stcinv[Reverse[Length/@Split[bpe[n],#2==#1+1&]]],{n,0,100}]

A232866 Positions of the nonnegative integers in the sequence (or tree) of complex numbers generated by these rules: 0 is in S, and if x is in S, then x + 1 and i*x are in S, where duplicates are deleted as they occur.

Original entry on oeis.org

1, 2, 3, 5, 9, 16, 27, 42, 61, 84, 111, 142, 177, 216, 259, 306, 357, 412, 471, 534, 601, 672, 747, 826, 909, 996, 1087, 1182, 1281, 1384, 1491, 1602, 1717, 1836, 1959, 2086, 2217, 2352, 2491, 2634, 2781, 2932, 3087, 3246, 3409, 3576, 3747, 3922, 4101, 4284
Offset: 1

Views

Author

Clark Kimberling, Dec 01 2013

Keywords

Comments

Let S be the sequence (or tree) of complex numbers defined by these rules: 0 is in S, and if x is in S, then x + 1, and i*x are in S. Deleting duplicates as they occur, the generations of S are given by g(1) = (0), g(2) = (1), g(3) = (2,i), g(4) = (3, 2i, 1+i, -1), ... Concatenating these gives 0, 1, 2, i, 3, 2*i, 1 + i, -1, 4, 3*i, 1 + 2*i, -2, 2 + i, -1 + i, -i, 5, ... It appears that if c and d are integers, than the positions of c*n+d*i, for n>=0, comprise a linear recurrence sequence with signature beginning with 3, -3, 1, following for zero or more 0's.

Examples

			Each x begets x + 1, and i*x, but if either these has already occurred it is deleted.  Thus, 0 begets (1); then 1 begets (2,i,); then 2 begets 3 and 2*i, and i begets 1 + i and -1, so that g(4) = (3, 2*i, 1 + i, -1), etc.
		

Crossrefs

Programs

  • Mathematica
    x = {0}; Do[x = DeleteDuplicates[Flatten[Transpose[{x, x + 1, I*x}]]], {40}]; x;
    t1 = Flatten[Table[Position[x, n], {n, 0, 30}]]   (* A232866 *)
    t2 = Flatten[Table[Position[x, -n], {n, 1, 30}]]  (* A232867 *)
    Union[t1, t2]  (* A232868 *)

Formula

a(n+4) = 2*n^2 + n + 6 for n >= 1 (conjectured).
G.f.: (-1 + x - x^3 - x^4 - x^5 - x^6)/(x -1)^3 (conjectured).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 8 (conjectured).

A232867 Positions of the negative integers in the sequence (or tree) of complex numbers generated by these rules: 0 is in S, and if x is in S, then x + 1 and i*x are in S, where duplicates are deleted as they occur.

Original entry on oeis.org

8, 12, 19, 30, 45, 64, 87, 114, 145, 180, 219, 262, 309, 360, 415, 474, 537, 604, 675, 750, 829, 912, 999, 1090, 1185, 1284, 1387, 1494, 1605, 1720, 1839, 1962, 2089, 2220, 2355, 2494, 2637, 2784, 2935, 3090, 3249, 3412, 3579, 3750, 3925, 4104, 4287, 4474
Offset: 1

Views

Author

Clark Kimberling, Dec 01 2013

Keywords

Comments

Let S be the sequence (or tree) of complex numbers defined by these rules: 0 is in S, and if x is in S, then x + 1, and i*x are in S. Deleting duplicates as they occur, the generations of S are given by g(1) = (0), g(2) = (1), g(3) = (2,i), g(4) = (3, 2i, 1+i, -1), ... Concatenating these gives 0, 1, 2, i, 3, 2*i, 1 + i, -1, 4, 3*i, 1 + 2*i, -2, 2 + i, -1 + i, -i, 5, ... It appears that if c and d are integers, than the positions of c*n+d*i, for n>=0, comprise a linear recurrence sequence with signature beginning with 3, -3, 1, following for zero or more 0's.

Examples

			Each x begets x + 1, and i*x, but if either these has already occurred it is deleted.  Thus, 0 begets (1); then 1 begets (2,i,); then 2 begets 3 and 2*i, and i begets 1 + i and -1, so that g(4) = (3, 2*i, 1 + i, -1), etc.; a(1) = 8 because -1 occurs in the 8th position of S.
		

Crossrefs

Programs

  • Mathematica
    x = {0}; Do[x = DeleteDuplicates[Flatten[Transpose[{x, x + 1, I*x}]]], {40}]; x;
    t1 = Flatten[Table[Position[x, n], {n, 0, 30}]]    (* A232866 *)
    t2 = Flatten[Table[Position[x, -n], {n, 1, 30}]]  (* A232867 *)
    Union[t1, t2]  (* A232868 *)

Formula

a(n+1) = 2*n^2 + n + 9 for n >= 1 (conjectured).
G.f.: (-8 + 12 x - 7 x^2 - x^3)/(x -1)^3 (conjectured).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 5 (conjectured).

A293247 Let S be the sequence of rational numbers generated by these rules: 1 is in S, and if u/v is in S (with gcd(u, v) = 1), then (u+1)/v and u/(v+1) are in S, and duplicates are deleted as they occur; a(n) = the numerator of the n-th term of S.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 03 2017

Keywords

Comments

See A293248 for the corresponding denominators.
The sequence S is a "rational" variant of A232559.
If r appears in S, then 1/r appears in S.
S is a permutation of the positive rational numbers:
- let f be the function u/v -> (u+1)/v
and g be the function u/v -> u/(v+1),
- let h^k be the k-th iterate of h,
- let r = u/v be a rational number in reduced form,
- without loss of generality, we can assume that u > v,
- according to Dirichlet's theorem on arithmetic progressions, we can choose a prime number p = k*u - 1 > u (where k > 2),
- we also have k*u - 1 > k*v,
- f^(p-1)(1) = p,
- g^(k*v-1)(f^(p-1)(1)) = p / (k*v) (and gcd(p, k*v)=1),
- f(g^(k*v-1)(f^(p-1)(1))) = (p+1) / (k*v) = (k*u) / (k*v) = u/v = r, QED.

Examples

			S(1) = 1 by definition; so a(1) = 1.
(1+1)/1 = 2 has not yet occurred; so S(2) = 2 and a(2) = 2.
1/(1+1) = 1/2 has not yet occurred; so S(3) = 1/2 and a(3) = 1.
(2+1)/1 = 3 has not yet occurred; so S(4) = 3 and a(4) = 3.
2/(1+1) = 1 has already occurred.
		

Crossrefs

Programs

  • PARI
    See Links section.

A232562 Inverse permutation of the sequence of positive integers at A232561.

Original entry on oeis.org

1, 2, 3, 5, 9, 4, 7, 13, 6, 11, 20, 10, 18, 33, 17, 31, 57, 8, 15, 27, 14, 25, 46, 24, 44, 81, 12, 22, 40, 21, 38, 70, 37, 68, 125, 19, 35, 64, 34, 62, 114, 61, 112, 206, 32, 59, 108, 58, 106, 195, 105, 193, 355, 16, 29, 53, 28, 51, 94, 50, 92, 169, 26, 48
Offset: 1

Views

Author

Clark Kimberling, Nov 26 2013

Keywords

Crossrefs

Programs

  • Mathematica
    z = 8; g[1] = {1}; g[2] = {2, 3}; g[n_] := Riffle[g[n - 1] + 1, 3 g[n - 1]]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232561 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A001590 *)
    t1 = Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232562 *)

A232564 Inverse permutation of the sequence of positive integers at A232563.

Original entry on oeis.org

1, 2, 4, 3, 6, 11, 21, 5, 9, 17, 33, 8, 15, 29, 56, 7, 13, 25, 48, 12, 23, 44, 85, 22, 42, 81, 156, 41, 79, 152, 293, 10, 19, 37, 71, 18, 35, 67, 129, 34, 65, 125, 241, 64, 123, 237, 457, 16, 31, 60, 115, 30, 58, 111, 214, 57, 109, 210, 405, 108, 208, 401
Offset: 1

Views

Author

Clark Kimberling, Nov 26 2013

Keywords

Crossrefs

Programs

  • Mathematica
    z = 8; g[1] = {1}; g[2] = {2, 4}; g[n_] := Riffle[g[n - 1] + 1, 4 g[n - 1]]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232563 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A001631 *)
    t1 = Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232564 *)

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

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 9, 8, 13, 11, 10, 17, 15, 14, 25, 12, 21, 19, 18, 33, 16, 29, 27, 26, 49, 23, 22, 41, 20, 37, 35, 34, 65, 31, 30, 57, 28, 53, 51, 50, 97, 24, 45, 43, 42, 81, 39, 38, 73, 36, 69, 67, 66, 129, 32, 61, 59, 58, 113, 55, 54, 105, 52, 101, 99
Offset: 1

Views

Author

Clark Kimberling, Nov 28 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 2*x - 1 are in S. Then S is the set of positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2), g(3) = (3), g(4) = (4,5), etc. Concatenating these gives A232638, a permutation of the positive integers. For n > 1, the number of numbers in g(n) is F(n-1), where F = A000045, the Fibonacci numbers. It is helpful to show the results as a tree with the terms of S as nodes, an edge from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x - 1 if 2*x - 1 has not already occurred.

Examples

			Each x begets x + 1 and 2*x - 1, but if either has already occurred it is deleted. Thus, 1 begets 2, which begets 3, which begets 4 and 5, which beget 7 and (6,8), respectively.
		

Crossrefs

Programs

  • Mathematica
    z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] - 1]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232638 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A000045 *)
    Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232639 *)

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

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 11, 9, 8, 15, 13, 12, 23, 10, 19, 17, 16, 31, 14, 27, 25, 24, 47, 21, 20, 39, 18, 35, 33, 32, 63, 29, 28, 55, 26, 51, 49, 48, 95, 22, 43, 41, 40, 79, 37, 36, 71, 34, 67, 65, 64, 127, 30, 59, 57, 56, 111, 53, 52, 103, 50, 99, 97, 96, 191
Offset: 1

Views

Author

Clark Kimberling, Nov 28 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 2*x + 1 are in S. Then S is the set of positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2,3), g(3) = (5,4,7), etc. Concatenating these gives A232640, a permutation of the positive integers. The number of numbers in g(n) is F(n), where F = A000045, the Fibonacci numbers. It is helpful to show the results as a tree with the terms of S as nodes, an edge from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x + 1 if 2*x + 1 has not already occurred.

Examples

			Each x begets x + 1 and 2*x + 1, but if either has already occurred it is deleted. Thus, 1 begets 2 and 3; then 2 begets only 5, and 3 begets (4,7), so that g(3) = (5,4,7).
		

Crossrefs

Programs

  • Mathematica
    z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] + 1]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* this sequence *)
    Table[Length[g1[n]], {n, 1, z}]  (* A000045 *)
    Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232641 *)

Formula

Conjecture: a(n) = A135533(A003754(n+1)) for n > 0. - Mikhail Kurkov, Feb 26 2023

A232641 Inverse permutation of the sequence of positive integers at A232640.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 10, 9, 15, 8, 13, 12, 20, 11, 18, 17, 28, 16, 26, 25, 41, 14, 23, 22, 36, 21, 34, 33, 54, 19, 31, 30, 49, 29, 47, 46, 75, 27, 44, 43, 70, 42, 68, 67, 109, 24, 39, 38, 62, 37, 60, 59, 96, 35, 57, 56, 91, 55, 89, 88, 143, 32, 52, 51, 83
Offset: 1

Views

Author

Clark Kimberling, Nov 28 2013

Keywords

Crossrefs

Programs

  • Mathematica
    z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] + 1]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]];
    g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* A232640 *)
    Table[Length[g1[n]], {n, 1, z}]  (* A000045 *)
    Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232641 *)
Previous Showing 21-30 of 41 results. Next