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

A186003 Distance array associated with ordering A057557 of N X N X N, by antidiagonals (distances to yz plane).

Original entry on oeis.org

1, 2, 4, 3, 8, 10, 5, 9, 18, 20, 6, 15, 19, 33, 35, 7, 16, 30, 34, 54, 56, 11, 17, 31, 51, 55, 82, 84, 12, 26, 32, 52, 79, 83, 118, 120, 13, 27, 47, 53, 80, 115, 119, 163, 165, 14, 28, 48, 75, 81, 116, 160, 164, 218, 220, 21, 29, 49, 76, 111, 117, 161, 215, 219, 284, 286, 22, 42, 50, 77, 112, 156, 162, 216, 281, 285, 362, 364
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2011

Keywords

Comments

Let n=n(i,j,k) be the position of (i,j,k) in the lexicographic ordering A057557 of N X N X N, where N={1,2,3,...}. Row h of A186003 lists those n for which i=n, the distance from (i,j,k) to the yz-plane. Every positive integer occurs exactly once in the array, so that as a sequence, A186003 is a permutation of the positive integers.

Examples

			Northwest corner:
   1,  2,  3,  5,  6,  7,  11
   4,  8,  9, 15, 16, 17,  26
  10, 18, 19, 30, 31, 32,  47
  20, 33, 34, 51, 52, 53,  75
  35, 54, 55, 79, 80, 81, 111
T(2,1)=4, the position of (2,1,1) in the ordering
(1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:=Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1];
    lexicographicLatticeHeightArray[{dim_,maxHeight_,axis_}]:=Array[Flatten@Position[Map[#[[axis]]&,lexicographicLattice[{dim,maxHeight}]],#]&,maxHeight];
    llha=lexicographicLatticeHeightArray[{3,12,1}];
    ordering=lexicographicLattice[{2,Length[llha]}];
    llha[[#1,#2]]&@@#1&/@ordering
    (* Peter J. C. Moses, Feb 15 2011 *)

A186004 Distance array associated with ordering A057557 of N X N X N, by antidiagonals (distances to xz plane).

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 5, 9, 13, 14, 8, 12, 17, 24, 25, 10, 16, 23, 29, 40, 41, 11, 19, 28, 39, 46, 62, 63, 15, 22, 32, 45, 61, 69, 91, 92, 18, 27, 38, 50, 68, 90, 99, 128, 129, 20, 31, 44, 60, 74, 98, 127, 137, 174, 175, 21, 34, 49, 67, 89, 105, 136, 173, 184, 230, 231, 26, 37, 53, 73, 97, 126, 144, 183, 229, 241, 297, 298
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2011

Keywords

Comments

Let n=n(i,j,k) be the position of (i,j,k) in the lexicographic ordering A057557 of N X N X N, where N={1,2,3,...}. Row h of A186004 lists those n for which j=n, the distance from (i,j,k) to the xz-plane. Every positive integer occurs exactly once in the array, so that as a sequence, A186004 is a permutation of the positive integers.

Examples

			Northwest corner:
   1,  2,  4,  5,  8, 10
   3,  6,  9, 12, 16, 19
   7, 13, 17, 23, 28, 32
  14, 24, 29, 39, 45, 50
  25, 40, 46, 61, 68, 74
T(2,2)=6, the position of (1,2,2) in the ordering
(1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:=Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1];
    lexicographicLatticeHeightArray[{dim_,maxHeight_,axis_}]:=Array[Flatten@Position[Map[#[[axis]]&,lexicographicLattice[{dim,maxHeight}]],#]&,maxHeight];
    llha=lexicographicLatticeHeightArray[{3,12,2}];
    ordering=lexicographicLattice[{2,Length[llha]}];
    llha[[#1,#2]]&@@#1&/@ordering
    (* Peter J. C. Moses, Feb 15 2011 *)

A186005 Distance array associated with ordering A057557 of N X N X N by antidiagonals (distances to xy plane).

Original entry on oeis.org

1, 3, 2, 4, 6, 5, 7, 8, 12, 11, 9, 13, 15, 22, 21, 10, 16, 23, 26, 37, 36, 14, 18, 27, 38, 42, 58, 57, 17, 24, 30, 43, 59, 64, 86, 85, 19, 28, 39, 47, 65, 87, 93, 122, 121, 20, 31, 44, 60, 70, 94, 123, 130, 167, 166, 25, 33, 48, 66, 88, 100, 131, 168, 176, 222, 221, 29, 40, 51, 71, 95, 124, 138, 177, 223, 232, 288, 287
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2011

Keywords

Comments

Let n=n(i,j,k) be the position of (i,j,k) in the lexicographic ordering A057557 of N X N X N, where N={1,2,3,...}. Row h of A186005 lists those n for which k=n, the distance from (i,j,k) to the xy-plane. Every positive integer occurs exactly once in the array, so that as a sequence, A186005 is a permutation of the positive integers.

Examples

			T(2,2)=6, the position of (1,2,2) in the ordering
(1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
Northwest corner:
   1,  3,  4,  7,  9, 10
   2,  6,  8, 13, 16, 18
   5, 12, 15, 23, 27, 30
  11, 22, 26, 38, 43, 47
  21, 37, 42, 59, 65, 70
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:=Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1];
    lexicographicLatticeHeightArray[{dim_,maxHeight_,axis_}]:=Array[Flatten@Position[Map[#[[axis]]&,lexicographicLattice[{dim,maxHeight}]],#]&,maxHeight];
    llha=lexicographicLatticeHeightArray[{3,12,3}];
    ordering=lexicographicLattice[{2,Length[llha]}];
    llha[[#1,#2]]&@@#1&/@ordering
    (* Peter J. C. Moses, Feb 15 2011 *)

A057555 Lexicographic ordering of N x N, where N = {1,2,3...}.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 07 2000

Keywords

Examples

			Flatten the ordered lattice points (1,1) < (1,2) < (2,1) < (1,3) < (2,2) < ... as 1,1, 1,2, 2,1, 1,3, 2,2, ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1]; Flatten@lexicographicLattice[{2,12}] (* Peter J. C. Moses, Feb 10 2011 *)
    u[x_] := Floor[3/2 + Sqrt[2*x]]; v[x_] := Floor[1/2 + Sqrt[2*x]]; n[x_] := x - v[x]*(v[x] - 1)/2; k[x_] := 1 - x + u[x]*(u[x] - 1)/2; Flatten[Table[{n[m], k[m]}, {m, 45}]] (* L. Edson Jeffery, Jun 20 2015 *)
  • PARI
    a(n)= if(n<1, 0, 1+(-1)^(n%2) * (binomial((n+1)%2+(sqrtint(4*n)+1)\2, 2)-n\2)) /* Michael Somos, Mar 06 2004 */

Formula

a(2n) = A004736(n), a(2n+1) = A002260(n). - Michael Somos, Mar 06 2004
Let p(i,j) be the position of (i,j) in the ordering. Then p(i,j) = ((i+j)^2-i-3j+2)/2. Inversely, the pair (i,j) in a given position p is given by i=p-q(q-1)/2 and j=q+1-i, where q=floor((1+sqrt(8k-7))/2).

Extensions

Extended by Clark Kimberling, Feb 10 2011

A057556 Lexicographic ordering of M x M x M, where M={0,1,2,...}.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 07 2000

Keywords

Comments

See A057557 for N x N x N, where N={1,2,3,...}.
The triples are sorted first according to their sum, then lexicographically. - Pontus von Brömssen, Aug 16 2023

Examples

			Flatten the list of ordered lattice points, (0,0,0) < (0,0,1) < (0,1,0) < ... to 0,0,0, 0,0,1, 0,1,0, ...
As a three-column array:
  0 0 0
  0 0 1
  0 1 0
  1 0 0
  0 0 2
  0 1 1
  0 2 0
  1 0 1
  1 1 0
  2 0 0
  0 0 3
  0 1 2
  0 2 1
  0 3 0
  1 0 2
  1 1 1
  1 2 0
  2 0 1
  2 1 0
  3 0 0
  ...
		

Crossrefs

Cf. A144625 (each triple reversed).

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1]; Flatten@lexicographicLattice[{3,6}]-1
    (* Peter J. C. Moses, Feb 10 2011 *)

Extensions

Extended by Clark Kimberling, Feb 10 2011

A057559 Lexicographic ordering of NxNxNxN, where N={1,2,3,...}.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 3, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2, 3, 1, 1, 3, 2, 1, 1, 4, 1, 1, 2, 1, 3, 1, 2, 2, 2, 1, 2, 3, 1, 1, 3, 1, 2, 1, 3, 2, 1, 1, 4, 1, 1, 2, 1, 1, 3, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 3, 1, 1, 3, 1, 1, 2, 3, 1, 2, 1, 3, 2, 1, 1, 4, 1, 1, 1
Offset: 1

Views

Author

Clark Kimberling, Sep 07 2000

Keywords

Examples

			Flatten the list of ordered lattice points, (1,1,1,1) < (1,1,1,2) < (1,1,2,1) < ... as 1,1,1,1, 1,1,1,2, 1,1,2,1, ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1]; Flatten@lexicographicLattice[{4,4}]
    (* by Peter J. C. Moses, Feb 10 2011 *)

Extensions

Extended by Clark Kimberling, Feb 10 2011

A057554 Lexicographic ordering of MxM, where M={0,1,2,...}.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 07 2000

Keywords

Comments

A057555 gives the lexicographic ordering of N x N, where N={1,2,3,...}.

Examples

			Flatten the ordered lattice points: (0,0) < (0,1) < (1,0) < (0,2) < (1,1) < ... as 0,0, 0,1, 1,0, 0,2, 1,1, ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1]; Flatten@lexicographicLattice[{2,12}]-1 (* Peter J. C. Moses, Feb 10 2011 *)
  • Python
    [l for i in range(20) for k in range(i,-1,-1) for l in (i-k, k)] # Nicholas Stefan Georgescu, Oct 10 2023

A057558 Lexicographic ordering of MxMxMxM, where M={0,1,2,...}.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 2, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 2, 1, 0, 0, 3, 0, 0, 1, 0, 2, 0, 1, 1, 1, 0, 1, 2, 0, 0, 2, 0, 1, 0, 2, 1, 0, 0, 3, 0, 0, 1, 0, 0, 2, 1, 0, 1, 1, 1, 0, 2, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 0, 0, 2, 0, 0, 1, 2, 0, 1, 0, 2, 1, 0, 0, 3, 0, 0, 0
Offset: 1

Views

Author

Clark Kimberling, Sep 07 2000

Keywords

Examples

			Flatten the list of ordered lattice points, (0,0,0,0) < (0,0,0,1) < (0,0,1,0) < ... as 0,0,0,0, 0,0,0,1, 0,0,1,0, ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1]; Flatten@lexicographicLattice[{4,4}]-1
    (* by Peter J. C. Moses, Feb 10 2011 *)

Extensions

Extended by Clark Kimberling, Feb 10 2011

A186006 Lexicographic ordering of N x N x N x N x N, where N={1,2,3,...}.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 3, 1, 1, 1, 3, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 3, 1, 1, 2, 2, 2, 1, 1, 2, 3, 1, 1, 1, 3, 1, 2, 1, 1, 3, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 3
Offset: 1

Views

Author

Clark Kimberling, Feb 10 2011

Keywords

Comments

By changing a single number, the Mathematica code suffices for other dimensions: N x N (A057555), N x N x N (A057557), N x N x N x N (A057559), and higher.

Examples

			First, list the 5-tuples in lexicographic order: (1,1,1,1,1) < (1,1,1,1,2) < (1,1,1,2,1) < (1,1,2,1,1) < ... < (1,2,2,1,1) < (1,1,3,1,1) < ... Then flatten the list, leaving 1,1,1,1,1, 1,1,1,1,2, 1,1,1,2,1, 1,1,2,1,1, ...
		

Crossrefs

Programs

  • Mathematica
    lexicographicLattice[{dim_,maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1];
    lexicographicLatticeHeightArray[{dim_,maxHeight_,axis_}]:= Array[Flatten@Position[Map[#[[axis]]&, lexicographicLattice[{dim,maxHeight}]],#]&,maxHeight]
    Take[Flatten@lexicographicLattice[{5,12}],160]
    (* Peter J. C. Moses, Feb 10 2011 *)
Showing 1-9 of 9 results.