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

A054424 Permutation of natural numbers: maps the canonical list of fractions (A020652/A020653) to whole Stern-Brocot (Farey) tree (top = 1/1 and both sides < 1 and > 1, but excluding the "fractions" 0/1 and 1/0).

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 5, 6, 15, 16, 31, 32, 9, 11, 12, 14, 63, 64, 10, 13, 127, 128, 17, 23, 24, 30, 255, 256, 19, 28, 511, 512, 33, 18, 20, 47, 48, 27, 29, 62, 1023, 1024, 22, 25, 2047, 2048, 65, 35, 39, 21, 95, 96, 26, 56, 60, 126, 4095, 4096, 34, 40, 55, 61, 8191, 8192
Offset: 1

Views

Author

Antti Karttunen

Keywords

Examples

			Whole Stern-Brocot tree: 1/1 1/2 2/1 1/3 2/3 3/2 3/1 1/4 2/5 3/5 3/4 4/3 5/3 5/2 4/1 1/5 2/7
Canonical fractions: 1/1 1/2 2/1 1/3 3/1 1/4 2/3 3/2 4/1 1/5 5/1 1/6 2/5 3/4 4/3 5/2 6/1
		

Crossrefs

Cf. A047679, A007305, A007306, A054427, A057114. In table form: A054425. Inverse permutation: A054426.

Programs

  • Maple
    cfrac2binexp := proc(c) local i,e,n; n := 0; for i from 1 to nops(c) do e := c[i]; if(i = nops(c)) then e := e-1; fi; n := ((2^e)*n) + ((i mod 2)*((2^e)-1)); od; RETURN(n); end;
    frac2position_in_whole_SB_tree := proc(r) local k,msb; if(1 = r) then RETURN(1); else if(r > 1) then k := cfrac2binexp(convert(r,confrac)); else k := ReflectBinTreePermutation(cfrac2binexp(convert(1/r,confrac))); fi; msb := floor_log_2(k); if(r > 1) then RETURN(k + (2^(msb+1))); else RETURN(k + (2^(msb+1)) - (2^msb)); fi; fi; end;
    canonical_fractions_to_whole_SternBrocot_permutation := proc(u) local a,n,i; a := []; for n from 2 to u do for i from 1 to n-1 do if (1 = igcd(n,i)) then a := [op(a),frac2position_in_whole_SB_tree(i/(n-i))]; fi; od; od; RETURN(a); end; # ReflectBinTreePermutation and floor_log_2 given in A054429

Formula

canonical_fractions_to_whole_SternBrocot_permutation(30);

A056537 Mapping from the column-by-column reading to the half-antidiagonal reading of the triangular tables. Inverse of A056536.

Original entry on oeis.org

1, 2, 4, 3, 6, 9, 5, 8, 12, 16, 7, 11, 15, 20, 25, 10, 14, 19, 24, 30, 36, 13, 18, 23, 29, 35, 42, 49, 17, 22, 28, 34, 41, 48, 56, 64, 21, 27, 33, 40, 47, 55, 63, 72, 81, 26, 32, 39, 46, 54, 62, 71, 80, 90, 100, 31, 38, 45, 53, 61, 70, 79, 89, 99, 110, 121, 37, 44, 52, 60, 69
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2000

Keywords

Comments

Moves triangular numbers (A000217) to squares (A000290), i.e., A056537(A000217(i)) = A000290(i) for i >= 1.
As a square array, this is the dispersion of the complement of the squares; see A082152. - Clark Kimberling, Apr 05 2003

Examples

			As a square array, a northwest corner:
1 ... 2 ... 3 ... 5 ... 7 ... 10
4 ... 6 ... 8 ... 11 .. 14 .. 18
9 ... 12 .. 15 .. 19 .. 23 .. 28
16 .. 20 .. 24 .. 29 .. 34 .. 40
25 .. 30 .. 35 .. 41 .. 47 .. 54
36 .. 42 .. 48 .. 55 .. 62 .. 70
49 .. 56 .. 63 .. 71 .. 79 .. 88
64 .. 72 .. 80 .. 89 .. 98 .. 108
- _Clark Kimberling_, Aug 08 2013
		

Crossrefs

Cf. A185787 (dispersion of complement of triangular numbers).
Cf. A082152 (dispersion of complement of pentagonal numbers).

Programs

  • Maple
    # using Maple procedure nthmember given in A054426:
    [seq(nthmember(j, A056536), j=1..105)];
  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r=40; r1=12; c=40; c1=12; f[n_] := n+Floor[1/2+Sqrt[n]] (* complement of column 1 *); mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]; rows = {NestList[f, 1, c]}; Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}]; t[i_, j_] := rows[[i, j]]; TableForm[Table[t[i, j], {i, 1, r1}, {j, 1, c1}]]  (* A056537 array *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A056537 sequence *)
    (* Clark Kimberling, Jun 06 2011 *)

Formula

Triangle T(n, k), 1<=k<=n, read by rows, defined by: T(n, k) = 0 for nA002620(n-k+1) + k*n + k - n if n>=k. T(n, n) = n^2; T(n, 1) = 1 + A002620(n) = A033638(n). - Philippe Deléham, Feb 16 2004
Square: t(n,k) = (n-1)(n+k) + k^2/4 + (1/8)(7+(-1)^k). - Clark Kimberling, Aug 08 2013

A056535 Mapping from the ordering by sum to the ordering by product of the ordered pairs. Inverse permutation to A056534.

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 6, 12, 13, 8, 9, 18, 22, 19, 10, 11, 25, 32, 33, 26, 14, 15, 31, 43, 48, 44, 34, 16, 17, 39, 55, 63, 64, 56, 40, 20, 21, 47, 68, 80, 86, 81, 69, 49, 23, 24, 54, 79, 98, 107, 108, 99, 82, 57, 27, 28, 62, 93, 116, 129, 136, 130, 117, 94, 65, 29, 30, 72, 106
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2000

Keywords

Comments

The last term of the each row r of the triangle is the first term of that row + (tau(r)-1).
As an array, T(n,k) is the index of the k-th term of A027750 whose value is n. - Michel Marcus, Oct 15 2015

Examples

			As a triangle, sequence begins:
1;
2, 3;
4, 7, 5;
6, 12, 13, 8;
9, 18, 22, 19, 10;
...
As an array, sequence begins:
1,   2,  4,  6,  9,  11,  15, ...
3,   7, 12, 18, 25,  31,  39, ...
5,  13, 22, 32, 43,  55,  68, ...
8,  19, 33, 48, 63,  80,  98, ...
10, 26, 44, 64, 86, 107, 129, ...
...
		

Crossrefs

A056535[A000217[i]] = A056535[A000217[i-1]+1]+A000005[i]-1, for all i >= 1.
Left edge: A054519, Right edge: A006218.

Programs

Formula

[seq(nthmember(j, A056534), j=1..105)];

A054428 Inverse permutation to A054427.

Original entry on oeis.org

1, 2, 4, 3, 6, 9, 8, 5, 10, 17, 21, 16, 15, 20, 14, 7, 12, 27, 40, 31, 39, 54, 45, 26, 25, 44, 51, 36, 30, 35, 24, 11, 18, 41, 63, 56, 70, 101, 92, 55, 62, 114, 136, 100, 90, 113, 77, 38, 37, 76, 110, 87, 99, 133, 109, 61, 50, 85, 98, 67, 49, 60, 34, 13, 22, 57, 94, 79, 117
Offset: 1

Views

Author

Antti Karttunen

Keywords

Programs

  • Maple
    [seq(nthmember(j, A054427),j=1..200)]; # nthmember as in A054426

A056018 Inverse permutation to A056017.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 6, 8, 10, 11, 9, 12, 13, 15, 16, 18, 20, 14, 17, 19, 21, 23, 24, 26, 28, 29, 31, 32, 22, 25, 27, 30, 33, 34, 36, 37, 39, 41, 42, 44, 45, 47, 49, 50, 52, 54, 35, 38, 40, 43, 46, 48, 51, 53, 55, 57, 58, 60, 62, 63, 65, 66, 68, 70, 71, 73, 75, 76, 78, 79, 81
Offset: 0

Views

Author

Antti Karttunen, Jun 08 2000

Keywords

Programs

  • Maple
    Maple procedure nthmember given in A054426.

Formula

[seq(nthmember(j, A056017)-1, j=0..233)];
Showing 1-5 of 5 results.