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

A226208 Zeckendorf distance between n and n+1.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			7 = 5 + 2 -> 3 + 1 -> 2, and 8 -> 5 -> 3 -> 2.  The total number of Zeckendorf downshifts (i.e., arrows) is 5, so that a(7) = D(7,8) = 5.
		

Crossrefs

Cf. A226080.

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}},    While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)]; lst = Map[d[#, # + 1] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226211 Zeckendorf distance between n and 2*n.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			11 = 8 + 3 -> 5 + 2 -> 3 + 1 -> 2, and 22 = 21 + 1 -> 13 -> 8 -> 5 -> 3 -> 2. The total number of Zeckendorf downshifts (i.e., arrows) is 8, so that a(11) = D(11,22) = 8.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)];
    lst = Map[d[#, 2#] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226212 Zeckendorf distance between n and floor(n/2).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			11 = 8 + 3 -> 5 + 2 -> 3 + 1 -> 2, and 5 -> 3 -> 2.  The total number of Zeckendorf downshifts (i.e., arrows) is 5, so that a(11) = D(11,5) = 5.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}},    While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1,
    Min[{Length[z1], Length[z2]}]] - 1)]; lst = Map[d[#, Floor[#/2]] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226209 Zeckendorf distance between n and n+2.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			7 = 5 + 2 -> 3 + 1 -> 2, and 9 = 8 + 1 -> 5 -> 3 -> 2.  The total number of Zeckendorf downshifts (i.e., arrows) is 5, so that a(7) = D(7,9) = 5.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}},    While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)]; lst = Map[d[#, # + 2] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226210 a(n) is the Zeckendorf distance between n and Fibonacci(n).

Original entry on oeis.org

0, 1, 1, 2, 0, 3, 6, 2, 5, 8, 11, 12, 6, 9, 12, 15, 16, 19, 20, 21, 13, 16, 19, 22, 23, 26, 27, 28, 31, 32, 33, 34, 35, 25, 28, 31, 34, 35, 38, 39, 40, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 45, 48, 51, 54, 55, 58, 59, 60, 63, 64, 65, 66, 67, 70
Offset: 1

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			7 = 5 + 2 -> 3 + 1 -> 2, and 13 -> 8 -> 5 -> 3 -> 2. The total number of Zeckendorf downshifts (i.e., arrows) is 6, so that a(7) = D(7,F(7)) = 6.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)];
    lst = Map[d[#, Fibonacci[#]] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226213 Zeckendorf distance between n and 2^n.

Original entry on oeis.org

1, 1, 2, 5, 7, 7, 6, 7, 12, 14, 17, 12, 17, 22, 20, 25, 25, 28, 30, 31, 33, 31, 36, 34, 39, 39, 32, 42, 45, 42, 48, 45, 51, 51, 43, 54, 57, 55, 60, 52, 63, 63, 60, 66, 63, 70, 72, 67, 75, 70, 78, 79, 81, 82, 84, 82, 87, 83, 88, 86, 91, 94, 88, 97, 89, 100
Offset: 1

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			6 = 5 + 1 -> 3, and 2^6 = 55 + 8 + 1 -> 34 + 5 -> 21 + 3 -> 13 + 2 -> 8 + 1 -> 5 -> 3. The total number of Zeckendorf downshifts (i.e., arrows) is 7, so that a(6) = D(6,64) = 7.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)];
    lst = Map[d[#, 2^#] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226214 Zeckendorf distance between n and n^2.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207.

Examples

			7 = 5 + 2, and 7^2 = 34 + 13 + 2 -> 21 + 8 + 1 -> 13 + 5 -> 8 + 3 -> 5 + 2. The total number of Zeckendorf downshifts (i.e., arrows) is 4, so that a(7) = D(7,49) = 4.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)];
    lst = Map[d[#, #^2] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226215 Zeckendorf distance between n! and (n+1)!.

Original entry on oeis.org

1, 2, 5, 11, 18, 20, 36, 45, 49, 53, 69, 83, 94, 105, 116, 122, 122, 146, 164, 178, 191, 204, 217, 229, 244, 253, 265, 263, 293, 309, 328, 339, 357, 372, 385, 400, 415, 430, 447, 462, 476, 490, 504, 516, 541, 536, 573, 580, 600, 618, 636, 654, 671, 686, 704
Offset: 1

Views

Author

Clark Kimberling, May 31 2013

Keywords

Comments

Zeckendorf distance is defined at A226207. For n = 100, the Zeckendorf distance between n! and (n+1)! is 704, compared to the linear distance which exceeds 10^150; in general, the Zeckendorf distance between two large integers tends to be notably less than the ordinary distance.

Examples

			4! = 21 + 3 -> 13 + 2 -> 8 + 1 -> 5 -> 3, and 5! = 89 + 21 + 8 + 2 -> 55 + 13 + 5 + 1 -> 34 + 8 + 3 -> 21 + 5 + 2 -> 13 + 3 + 1 -> 8 + 2 -> 5 + 1 -> 3. The total number of Zeckendorf downshifts (i.e., arrows) is 4 + 7, so that a(4) = D(24,120) = 11.
		

Crossrefs

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)];
    lst = Map[d[#!, (#+1)!] &, Range[100]] (* Peter J. C. Moses, May 30 2013 *)

A226456 Array by antidiagonals: D(m,n) = binary distance between m and n.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 2, 2, 2, 2, 2, 1, 0, 1, 2, 2, 1, 3, 3, 1, 2, 2, 3, 3, 0, 3, 3, 2, 3, 3, 1, 2, 2, 1, 3, 3, 3, 2, 1, 4, 0, 4, 1, 2, 3, 3, 2, 4, 4, 4, 4, 4, 4, 2, 3, 3, 2, 4, 1, 4, 0, 4, 1, 4, 2, 3, 3, 2, 4, 1, 3, 2, 2, 3, 1, 4, 2, 3, 3, 4, 4, 3, 3, 5, 0, 5
Offset: 1

Views

Author

Clark Kimberling, Jun 08 2013

Keywords

Comments

Method 1. In base 2, write m = m(0) + m(1)*2 + ... + m(i)*2^i and n = n(0) + n(1)*2 + ... + n(j)*2^j. Let c be the greatest h such that m(h) = n(h) for h = 0,...,c, and let r(m,n) = m(0) + m(1)*2 + ... + m(c)*2^c. For every positive integer k, let g(k) be the number of binary digits of k. Then D(m,n) = g(m) + g(n) - 2*g(r(m,n)).
Method 2. Let S be the set determined by these rules: 1 is in S, and if x is in S, then x+1 and 1/(x+1) are in S. As in A226080, grow the tree from the root 1, and then replace each number by the order in which it was generated. In the resulting tree, D(m,n) is the number of edges from m to n; i.e., D is the graph metric of the tree. The tree is also determined by the condition that if m < n, then m and n are connected by an edge if and only if m = floor(n/2).
The set S consists of all the positive rationals, of which the first 15 are indicated in generations by (1), (2, 1/2), (3 ,1/3, 3/2, 2/3), (4, 1/4, 4/3, 3/4, 5/2, 2/5, 5/3, 3/5). One outermost branch of the tree consists of 1,2,3,4,... and the other involves Fibonacci numbers: 1, 1/2, 2/3, 3/5,...
D(n,1)+1 is the number of digits in (n base 2); D(n,n+1) = A101688(n) for n>=1.

Examples

			Northwest corner of the distance table:
0 1 1 2 2 2 2 3 3 3
1 0 2 1 1 3 3 2 2 2
1 2 0 3 3 1 1 4 4 4
2 1 3 0 2 4 4 1 1 3
2 1 3 2 0 4 4 3 3 1
2 3 1 4 4 0 2 5 5 5
2 3 1 4 4 2 0 5 5 5
3 2 4 1 3 5 5 0 2 4
3 2 4 1 3 5 5 2 0 4
3 2 4 3 1 5 5 4 4 0
Row 9, column 6 is occupied by 5, meaning that D(9,6) = 5, a count of edges in the subgraph 9 -> 4 -> 2 -> 1 -> 3 ->6.
		

Crossrefs

Programs

  • Mathematica
    r = 1/2; f[x_] := Floor[r*x]; z = 20; g[x_] := FixedPointList[f, x]; u[x_] := Length[g[x]];  v[x_, y_] := Max[Intersection[g[x], g[y]]]; d[x_, y_] := u[x] + u[y] - 2*Length[g[v[x, y]]]; TableForm[Table[d[m, n], {m, 1, z}, {n, 1, z}]] (* A226456 array *)
    Flatten[Table[d[k, n + 1 - k], {n, 1, z}, {k, 1, n}]] (* A226456 sequence *)
    Table[d[n, n + 1], {n, 1, 100}] (* A101688 *)
    Table[d[n, 2^n], {n, 1, 100}]   (* A226457 *)

A226324 Array by antidiagonals: D(m,n) = distance between m and n using the graph-metric of A226247.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 2, 1, 1, 2, 3, 1, 0, 1, 3, 3, 2, 2, 2, 2, 3, 4, 2, 1, 0, 1, 2, 4, 4, 3, 1, 3, 3, 1, 3, 4, 4, 3, 2, 3, 0, 3, 2, 3, 4, 5, 3, 2, 4, 2, 2, 4, 2, 3, 5, 5, 4, 2, 4, 1, 0, 1, 4, 2, 4, 5, 5, 4, 3, 4, 1, 3, 3, 1, 4, 3, 4, 5, 5, 4, 3, 5, 3, 3, 0, 3
Offset: 1

Views

Author

Clark Kimberling, Jun 04 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 0 is in S; if x is in S, then x+1 is in S, and if nonzero x is in S, then -1/x is in S. Then S is the set of all rational numbers, produced in generations as follows:
g(1) = (0), g(2) = (1), g(3) = (2, -1), g(4) = (3, -1/2), g(5) = (4,-1/3,1/2),... For n > 2, 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. This order of generation matches a tree with (0,1), (1,2), (1,-1), (2,3), (2,-1/2), (3,4), (4,-1/3), (-1/2,1/2), etc. Replace each node by the order in which it is generated, so that the nodes labeled (0,1,2,-1,3,-1/2,4,-1/3,...) get new labels (1,2,3,4,5,6,...), respectively. If m and n are positive integers, then D(m,n) is the number of edges between m and n.

Examples

			Northwest corner of the distance table:
0 1 2 2 3 3 4 4 4 5
1 0 1 1 2 2 3 3 3 4
2 1 0 2 1 1 2 2 2 3
2 1 2 0 3 3 4 4 4 5
3 2 1 3 0 2 1 1 3 2
3 2 1 3 2 0 3 3 1 4
4 3 2 4 1 3 0 2 4 1
4 3 2 4 1 3 2 0 4 3
4 3 2 4 3 1 4 4 0 5
5 4 3 5 2 4 1 3 5 0
Row 5, column 4 is occupied by 3, meaning that D(5,4) = 3, a count of edges in the subgraph 5 -> 3 -> 2 -> 4.
		

Crossrefs

Programs

  • Mathematica
    $MaxExtraPrecision = Infinity; g[1] := {1}; g[2] := {1, 0}; g[3] := {1, 0, 0}; g[test_] := Module[{topRow, len, tmp = test, noOfTerms = Ceiling[Log[test]/Log[1.465571231876768026656731]] - 1}, topRow = Flatten[{1, LinearRecurrence[{1, 0, 1}, {2, 3, 5}, noOfTerms]}]; If[First[#] == 0, Rest[#], #] &[Table[If[# >= 0, tmp = #; 1, 0] &[tmp - topRow[[n]]], {n, noOfTerms, 1, -1}]]]; d[n1_, n2_] := Module[{z1 = g[n1], z2 = g[n2]}, Length[z1] + Length[z2] - 2(NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)]; (dArray = Table[d[m, n], {m, 1, #}, {n, 1, #}] &[15]) // TableForm
      Flatten[Table[d[k, n + 1 - k], {n, 1, 15}, {k, 1, n}]]
      ArrayPlot[dArray, ColorFunction -> "BlueGreenYellow"]
    (* Peter J. C. Moses, Jun 02 2013 *)
Showing 1-10 of 10 results.