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.

A257705 Sequence (a(n)) generated by Rule 1 (in Comments) with a(1) = 0 and d(1) = 0.

Original entry on oeis.org

0, 1, 3, 2, 5, 9, 7, 4, 10, 6, 11, 18, 13, 21, 15, 8, 17, 27, 19, 30, 20, 32, 23, 12, 25, 39, 26, 14, 29, 45, 31, 16, 33, 51, 35, 54, 37, 57, 38, 59, 41, 63, 43, 22, 46, 24, 47, 72, 49, 75, 50, 77, 53, 81, 55, 28, 58, 87, 56, 88, 60, 91, 62, 95, 65, 99, 67
Offset: 1

Views

Author

Clark Kimberling, May 12 2015

Keywords

Comments

Rule 1 follows. For k >= 1, let A(k) = {a(1), …, a(k)} and D(k) = {d(1), …, d(k)}. Begin with k = 1 and nonnegative integers a(1) and d(1).
Step 1: If there is an integer h such that 1 - a(k) < h < 0 and h is not in D(k) and a(k) + h is not in A(k), let d(k+1) be the greatest such h, let a(k+1) = a(k) + h, replace k by k + 1, and repeat Step 1; otherwise do Step 2.
Step 2: Let h be the least positive integer not in D(k) such that a(k) + h is not in A(k). Let a(k+1) = a(k) + h and d(k+1) = h. Replace k by k+1 and do Step 1.
Conjecture: if a(1) is an nonnegative integer and d(1) is an integer, then (a(n)) is a permutation of the nonnegative integers (if a(1) = 0) or a permutation of the positive integers (if a(1) > 0). Moreover, (d(n)) is a permutation of the integers if d(1) = 0, or of the nonzero integers if d(1) > 0.
Guide to related sequences:
a(1) d(1) (a(n)) (d(n))
0 0 A257705 A131389 except for initial terms
0 1 A257706 A131389 except for initial terms
0 2 A257876 A131389 except for initial terms
1 1 A257878 A131389 except for initial terms
2 1 A257881 A257880 except for initial terms

Examples

			a(2) = a(1) + d(2) = 0 + 1 = 1;
a(3) = a(2) + d(3) = 1 + 2 = 3;
a(4) = a(3) + d(4) = 3 + (-1) = 2.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 0; d[1] = 0; k = 1; z = 10000; zz = 120;
    A[k_] := Table[a[i], {i, 1, k}]; diff[k_] := Table[d[i], {i, 1, k}];
    c[k_] := Complement[Range[-z, z], diff[k]];
    T[k_] := -a[k] + Complement[Range[z], A[k]];
    s[k_] := Intersection[Range[-a[k], -1], c[k], T[k]];
    Table[If[Length[s[k]] == 0, {h = Min[Intersection[c[k], T[k]]], a[k + 1] = a[k] + h, d[k + 1] = h, k = k + 1}, {h = Max[s[k]], a[k + 1] = a[k] + h, d[k + 1] = h, k = k + 1}], {i, 1, zz}];
    u = Table[a[k], {k, 1, zz}] (* A257705 *)
    Table[d[k], {k, 1, zz}]     (* A131389 *)

Formula

a(k+1) - a(k) = d(k+1) for k >= 1.
Also, a(k) = A131388(n)-1.

A257698 Number of steps from n to 1 using this algorithm: x -> floor(r*x) if x is odd, and x -> floor(x/r) if x is even, where r = 3/2.

Original entry on oeis.org

0, 1, 3, 2, 6, 3, 5, 7, 13, 4, 6, 8, 12, 14, 16, 5, 13, 9, 11, 13, 17, 15, 17, 6, 12, 14, 16, 10, 14, 14, 16, 18, 28, 16, 18, 7, 11, 13, 15, 15, 21, 11, 13, 15, 19, 15, 17, 19, 27, 29, 31, 17, 21, 8, 10, 12, 18, 14, 16, 16, 20, 22, 24, 12, 24, 16, 18, 20, 24
Offset: 1

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			5->7->10->6->4->2->1, total of 6 steps, so that a(5) = 6.
		

Crossrefs

Programs

  • Mathematica
    r = 3/2; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]

A257699 Number of steps from n to 0 using this algorithm: x -> floor(r*x) if x is odd, and x -> floor(x/r) if x is even, where r = 5/2.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			5->12->4->1->2->0, total of 5 steps, so that a(5) = 5.
		

Crossrefs

Programs

  • Mathematica
    r = 5/2; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]

A257700 Number of steps from n to 1 using this algorithm: x -> floor(r*x) if x is odd, and x -> floor(x/r) if x is even, where r = 5/3.

Original entry on oeis.org

0, 1, 5, 2, 4, 6, 10, 3, 11, 7, 9, 11, 17, 4, 10, 12, 14, 8, 26, 12, 16, 18, 20, 5, 9, 11, 19, 13, 15, 9, 25, 27, 37, 13, 15, 17, 23, 19, 23, 6, 8, 10, 14, 12, 18, 20, 22, 14, 32, 10, 24, 26, 28, 28, 36, 38, 42, 14, 16, 18, 22, 24, 34, 20, 22, 24, 30, 7, 13
Offset: 1

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			5->8->4->2->1, total of 4 steps, so that a(5) = 4.
		

Crossrefs

Programs

  • Mathematica
    r = 5/3; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]

A257701 Number of steps from n to 1 using this algorithm: x -> floor(r*x) if x is odd, and x -> floor(x/r) if x is even, where r = sqrt(3).

Original entry on oeis.org

0, 1, 5, 2, 4, 6, 8, 3, 16, 5, 9, 7, 9, 4, 15, 17, 21, 6, 8, 10, 12, 8, 18, 10, 14, 16, 18, 18, 20, 22, 32, 7, 11, 9, 11, 11, 13, 13, 17, 19, 23, 11, 13, 15, 19, 17, 21, 19, 21, 19, 21, 23, 31, 33, 37, 8, 10, 12, 14, 10, 22, 12, 16, 12, 14, 14, 16, 18, 22
Offset: 1

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			7->12->6->3->5->8->4->2->1, total of 8 steps, so that a(7) = 8.
		

Crossrefs

Programs

  • Mathematica
    r = Sqrt[3]; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]

A257702 Number of steps from n to 0 using this algorithm: x -> floor(r*x) if x is odd, and x -> floor(x/r) if x is even, where r = sqrt(5).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			5->11->24->10->4->1->2->0, total of 7 steps, so that a(5) = 7.
		

Crossrefs

Programs

  • Mathematica
    r = Sqrt[5]; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]

A257703 Number of steps from n to 0 using this algorithm: x -> floor(e*x) if x is odd, and x -> floor(x/e) if x is even.

Original entry on oeis.org

2, 1, 3, 3, 11, 2, 8, 2, 4, 4, 8, 4, 10, 12, 14, 12, 14, 3, 7, 9, 13, 3, 5, 3, 7, 5, 9, 5, 7, 9, 11, 9, 17, 5, 9, 11, 13, 11, 13, 13, 19, 15, 17, 13, 15, 13, 25, 15, 23, 4, 6, 8, 10, 8, 14, 10, 12, 14, 16, 4, 8, 4, 8, 6, 8, 4, 6, 8, 12, 8, 10, 6, 8, 10, 20
Offset: 1

Views

Author

Clark Kimberling, May 04 2015

Keywords

Examples

			5->13->35->95->258->94->34->12->4->1->2->0, total of 11 steps, so that a(5) = 11.
		

Crossrefs

Programs

  • Mathematica
    r = E; f[x_] := If[OddQ[x], Floor[r *x], Floor[x/r]]
    g[x_] := Drop[FixedPointList[f, x], -1];
    Table[-1 + Length[g[n]], {n, 1, 200}]
Showing 1-7 of 7 results.