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

A057557 Lexicographic ordering of NxNxN, where N={1,2,3,...}.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 3, 1, 2, 2, 1, 3, 1, 2, 1, 2, 2, 2, 1, 3, 1, 1, 1, 1, 4, 1, 2, 3, 1, 3, 2, 1, 4, 1, 2, 1, 3, 2, 2, 2, 2, 3, 1, 3, 1, 2, 3, 2, 1, 4, 1, 1, 1, 1, 5, 1, 2, 4, 1, 3, 3, 1, 4, 2, 1, 5, 1, 2, 1, 4, 2, 2, 3, 2, 3, 2, 2, 4, 1, 3, 1, 3, 3, 2, 2, 3, 3, 1, 4, 1, 2, 4, 2, 1, 5, 1, 1, 1, 1, 6, 1, 2, 5, 1, 3, 4, 1, 4, 3, 1, 5, 2, 1, 6, 1, 2, 1, 5, 2, 2, 4, 2, 3, 3, 2, 4, 2, 2, 5, 1, 3, 1, 4, 3, 2, 3, 3, 3, 2, 3, 4, 1, 4, 1, 3, 4, 2, 2, 4, 3, 1, 5, 1, 2, 5, 2, 1, 6, 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,2) < (1,2,1) < ..., to 1,1,1, 1,1,2, 1,2,1, ...
		

Crossrefs

A057555: ordering of N^2
A057559: ordering of N^4
A186006: ordering of N^5
A186003: distances to the plane x=0
A186004: distances to the plane y=0
A186005: distances to the plane z=0

Programs

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

Extensions

Corrected and 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

A224195 Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1.

Original entry on oeis.org

3, 5, 7, 9, 13, 15, 17, 25, 29, 31, 33, 49, 57, 61, 63, 65, 97, 113, 121, 125, 127, 129, 193, 225, 241, 249, 253, 255, 257, 385, 449, 481, 497, 505, 509, 511, 513, 769, 897, 961, 993, 1009, 1017, 1021, 1023, 1025, 1537, 1793, 1921, 1985, 2017, 2033, 2041, 2045, 2047
Offset: 1

Views

Author

Brad Clardy, Apr 01 2013

Keywords

Comments

The table is constructed so that row labels are 2^n - 1, and column labels are 2^n. The body of the table is the row*col + 1. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner.
All of these numbers have the following property:
let m be a member of A(n),
if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then
the differences between successive members of B(n) is a repeating series
of 1's with the last difference in the pattern m. The number of ones in
the pattern is 2^j - 1, where j is the column index.
As an example consider A(4) which is 9,
the sequence B(n) where i XOR 8 = i - 8 starts as:
8, 9, 10, 11, 12, 13, 14, 15, 24... (A115419)
with successive differences of:
1, 1, 1, 1, 1, 1, 1, 9.
The main diagonal is the 6th cyclotomic polynomial evaluated at powers of two (A020515).
The formula for diagonals above the main diagonal
2^(2*n+1) - 2^(n + (a+1)/2) + 1 n>=(a+1)/2 a=odd number above diagonal
2^(2*n) - 2^(n + (b/2)) + 1 n>=(b/2)+1 b=even number above diagonal
The formulas for diagonals below the main diagonal
2^(2*n+1) - 2^(n + 1 -(a+1)/2) + 1 n>=(a+1)/2 a=odd number below diagonal
2^(2*n) - 2^(n - (b/2)) + 1 n>=(b/2)+1 b=even number below diagonal
Primes of this sequence are in A152449.

Examples

			Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
  +1  |    2    4     8    16    32     64    128    256     512    1024 ...
  ----|-----------------------------------------------------------------
  1   |    3    5     9    17    33     65    129    257     513    1025
  3   |    7   13    25    49    97    193    385    769    1537    3073
  7   |   15   29    57   113   225    449    897   1793    3585    7169
  15  |   31   61   121   241   481    961   1921   3841    7681   15361
  31  |   63  125   249   497   993   1985   3969   7937   15873   31745
  63  |  127  253   505  1009  2017   4033   8065  16129   32257   64513
  127 |  255  509  1017  2033  4065   8129  16257  32513   65025  130049
  255 |  511 1021  2041  4081  8161  16321  32641  65281  130561  261121
  511 | 1023 2045  4089  8177 16353  32705  65409 130817  261633  523265
  1023| 2047 4093  8185 16369 32737  65473 130945 261889  523777 1047553
  ...
		

Crossrefs

Cf. A081118, A152449 (primes), A057555 (lexicographic ordering), A115419 (example).
Rows: A000051(i=1), A181565(2), A083686(3), A195744(4), A206371(5), A196657(6).
Cols: A000225(j=1), A036563(2), A048490(3), A176303 (7 offset of 8).
Diagonals: A020515 (main), A092440, A060867 (above), A134169 (below).

Programs

  • Magma
    //program generates values in a table form
    for i:=1 to 10 do
        m:=2^i - 1;
        m,[ m*2^n +1 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(i-j) + 1;
           if IsPrime(k) then k,"*";
              else k;
           end if;;
        end for;
    end for;
  • Mathematica
    Table[(2^j-1)*2^(i-j+1) + 1, {i, 10}, {j, i}] (* Paolo Xausa, Apr 02 2024 *)

Formula

a(n) = (2^(A057555(2*n-1)) - 1)*2^(A057555(2*n)) + 1 for n>=1. [corrected by Jason Yuen, Feb 22 2025]
a(n) = A081118(n)+2; a(n)=(2^i-1)*2^j+1, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 04 2013

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

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 *)

A224701 Table read by antidiagonals of numbers of form (2^n - 1)*2^(m+3) + 5 where n>=1, m>=1.

Original entry on oeis.org

21, 37, 53, 69, 101, 117, 133, 197, 229, 245, 261, 389, 453, 485, 501, 517, 773, 901, 965, 997, 1013, 1029, 1541, 1797, 1925, 1989, 2021, 2037, 2053, 3077, 3589, 3845, 3973, 4037, 4069, 4085, 4101, 6149, 7173, 7685, 7941, 8069, 8133, 8165, 8181, 8197, 12293, 14341, 15365, 15877, 16133
Offset: 1

Views

Author

Brad Clardy, Apr 16 2013

Keywords

Comments

The table has row labels 2^n - 1 and column labels 2^(m+3). The table entry is row*col + 5. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner. Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
+5 | 16 32 64 128 256 512 1024 ...
----|-------------------------------------------
1 | 21 37 69 133 261 517 1029
3 | 53 101 197 389 773 1541 3077
7 | 117 229 453 901 1797 3589 7173
15 | 245 485 965 1925 3845 7685 15365
31 | 501 997 1989 3973 7941 15877 31749
63 | 1013 2021 4037 8069 16133 32261 64517
127 | 2037 4069 8133 16261 32517 65029 130053
...
All of these numbers have the following property: let m be a member of A(n); if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then the differences between successive members of B(n) is a repeating series
of 1,1,1,5 ending with 1,1,1 and the last difference in the pattern m. The total number of 1's and 5's in the pattern is 2^(j+2) - 1, where j is the column index.
As an example, consider A(1), which is 21; the sequence B(n) where i XOR 20 = i - 20 starts as 20, 21, 22, 23, 28, 29, 30, 31, 52, ... with successive differences of 1, 1, 1, 5, 1, 1, 1, 21.
for A(2), which is 37, the sequence B(n) where i XOR 36 = i - 36 starts as 36, 37, 38, 39, 44, 45, 46, 47, 52, 53, 54, 55, 60, 61, 62, 63, 100, ... with successive differences of 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 37.

Crossrefs

Cf. A057555 (lexicographic ordering).
Rows: A168614(i=1), n>=4.
Cols: A220087(j=2), n>=6.

Programs

  • Magma
    //program generates values in a table form, row labels of 2^i -1
    for i:=1 to 10 do
        m:=2^i - 1;
        m, [ m*2^(n+3) +5 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(3+i-j) + 5;
           if IsPrime(k) then k, "*";
              else k;
           end if;
        end for;
    end for;

Formula

a(n) = 2^(A057555(2*n - 1))*2^(A057555(2*n) + 3) + 5 for n>=1.

A181118 Sequencing of all rational numbers p/q > 0 as ordered pairs (p,q). The rational (p,q) occurs as the n-th ordered pair where n=(p+q-1)*(p+q-2)/2+q.

Original entry on oeis.org

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

Views

Author

Frank M Jackson, Oct 04 2010

Keywords

Comments

From L. Edson Jeffery, Dec 17 2011: (Start)
Arrange the ordered pairs in rows
(1,1)
(2,1),(1,2)
(3,1),(2,2),(1,3)
etc., and let the rows be indexed by n=1,2,.... Then the sum of the products of the pairs in row n is equal to A000292(n). For example, for n=3, 3*1+2*2+1*3=A000292(3)=10. (End)

Examples

			Triangle begins:
1,1                  : 1/1;
2,1,1,2              : 2/1, 1/2;
3,1,2,2,1,3          : 3/1, 2/2, 1/3;
4,1,3,2,2,3,1,4      : 4/1, 3/2, 2/3, 1/4;
5,1,4,2,3,3,2,4,1,5  : 5/1, 4/2, 3/3, 2/4, 1/5;
...
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table [{n+1-r, r}, {n, 9}, {r, n}]]
    u[x_] := Floor[3/2 + Sqrt[2*x]]; v[x_] := Floor[1/2 + Sqrt[2*x]]; n[x_] := 1 - x + u[x]*(u[x] - 1)/2; k[x_] := x - v[x]*(v[x] - 1)/2; Flatten[Table[{n[m], k[m]}, {m, 45}]] (* L. Edson Jeffery, Jun 20 2015 *)
  • PARI
    for(n=1,9,for(r=1,n,print1(n+1-r", "r", "))) \\ Charles R Greathouse IV, Dec 20 2011

Formula

Triangle format R(n,m) of ordered pairs (R(n,2r-1), R(n,2r)) with R(n,2r-1)=n+1-r and R(n,2r)=r and generating the rational (n+1-r)/r.

Extensions

Typo corrected and tabl changed to tabf by Frank M Jackson, Oct 07 2010

A224380 Table read by antidiagonals of numbers of form (2^n -1)*2^(m+2) + 3 where n>=1, m>=1.

Original entry on oeis.org

11, 19, 27, 35, 51, 59, 67, 99, 115, 123, 131, 195, 227, 243, 251, 259, 387, 451, 483, 499, 507, 515, 771, 899, 963, 995, 1011, 1019, 1027, 1539, 1795, 1923, 1987, 2019, 2035, 2043, 2051, 3075, 3587, 3843, 3971, 4035, 4067, 4083, 4091, 4099, 6147, 7171, 7683, 7939, 8067, 8131, 8163, 8179
Offset: 1

Views

Author

Brad Clardy, Apr 05 2013

Keywords

Comments

The table has row labels 2^n - 1 and column labels 2^(m+2). The table entry is row*col + 3. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner. Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
+3 | 8 16 32 64 128 256 512 ...
----|-------------------------------------------
1 | 11 19 35 67 131 259 515
3 | 27 51 99 195 387 771 1539
7 | 59 115 227 451 899 1795 3587
15 | 123 243 483 963 1923 3843 7683
31 | 251 499 995 1987 3971 7939 15875
63 | 507 1011 2019 4035 8067 16131 32259
127 | 1019 2035 4067 8131 16259 32515 65027
...
All of these numbers have the following property: let m be a member of A(n); if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then the differences between successive members of B(n) is an alternating series of 1's and 3's with the last difference in the pattern m. The number of alternating 1's and 3's in the pattern is 2^(j+1) - 1, where j is the column index.
As an example consider A(1) which is 11, the sequence B(n) where i XOR 10 = i - 10 starts as 10, 11, 14, 15, 26, 27, 30, 31, 42, ... (A214864) with successive differences of 1, 3, 1, 11.
Main diagonal is A191341, the largest k such that k-1 and k+1 in binary representation have the same number of 1's and 0's

Crossrefs

Cf. A057555(lexicographic ordering), A214864(example), A224195.
Rows: A062729(i=1), A147595(2 n>=5), A164285(3 n>=3).
Cols: A168616(j=1 n>=4).
Diagonal: A191341.

Programs

  • Magma
    //program generates values in a table form,row labels of 2^i -1
    for i:=1 to 10 do
        m:=2^i - 1;
        m, [ m*2^n +1 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(2+i-j) + 3;
           if IsPrime(k) then k, "*";
              else k;
           end if;;
        end for;
    end for;

Formula

a(n) = 2^(A057555(2*n - 1))*2^(A057555(2*n) + 2) + 3 for n>=1.
Showing 1-8 of 8 results.