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.

A269526 Square array T(n,k) (n>=1, k>=1) read by antidiagonals upwards in which each term is the least positive integer satisfying the condition that no row, column, diagonal, or antidiagonal contains a repeated term.

Original entry on oeis.org

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

Views

Author

Alec Jones, Apr 07 2016

Keywords

Comments

An infinite Sudoku-type array.
In the definition, "diagonal" means a diagonal line of slope -1, and "antidiagonal" means a diagonal line of slope +1.
Theorem C (Bob Selcoe, Jul 01 2016): Every column is a permutation of the natural numbers.
Proof: Fix k, and suppose j is the smallest number missing from that column. For this to happen, every entry T(n,k) for sufficiently large n in that column must see a j in the NW diagonal through that cell or in the row to the W of that cell. But there are at most k-1 copies of j in the columns to the left of the k-th column, and if n is very large the entry T(n,k) will be unaffected by those j's, and so T(n,k) would then be set to j, a contradiction. QED
Theorem R (Rob Pratt, Bob Selcoe, N. J. A. Sloane, Jul 02 2016): Every row is a permutation of the natural numbers.
Proof: Fix n, and suppose j is the smallest number missing from that row. For this to happen, every entry T(n,k) for sufficiently large k in that row must see a j in the column to the N, or in the NW diagonal through that cell or in the SW diagonal through that cell.
Rows 1 through n-1 contain at most n-1 copies of j, and their influence on the entries in the n-th row only extend out to the entry T(n,k_0), say. We take k to be much larger than k_0 and consider the entry T(n,k). We will show that for large enough k it can (and therefore must) be equal to j, which is a contradiction.
Consider the triangle bounded by row n, column 1, and the SW antidiagonal through cell (n,k). Replace every copy of j in this triangle by a queen and think of these cells as a triangular chessboard. These are non-attacking queens, by definition of the sequence, and by the result in A274616 there can be at most 2*k/3 + 1 such queens. However, there are k-k_0 cells in row n that have to be attacked, and for large k this is impossible since k-k_0 > 2*k/3+1. If a cell (n,k) is not attacked by a queen, then T(n,k) can take the value j. QED
Presumably every diagonal is also a permutation of the natural numbers, but the proof does not seem so straightforward. Of course the antidiagonals are not permutations of the natural numbers, since they are finite in length. - N. J. A. Sloane, Jul 02 2016
For an interpretation of this array in terms of Sprague-Grundy values, see A274528.
From Don Reble, Jun 30 2016: (Start)
Let b(n) be the position in column n where 1 appears, i.e., such that T(b(n),n) = 1. Then b(n) is A065188, which is Antti Karttunen's "Greedy Queens" permutation.
Let b'(n) be the position in row n where 1 appears, i.e., such that T(n,b'(n)) = 1. Then b'(n) is A065189, the inverse "Greedy Queens" permutation. (End)
The same sequence arises if we construct a triangle, by reading from left to right in each row, always choosing the smallest positive number which does not produce a duplicate number in any row or diagonal. - N. J. A. Sloane, Jul 02 2016
It appears that the numbers generally appear for the first time in or near the first few rows. - Omar E. Pol, Jul 03 2016
The last comment in the FORMULA section seems wrong: It seems that columns 4, 5, 6, 7, 8, 9, ...(?) all have first differences which become 16-periodic from, respectively, term 8, 17, 52, 91, 92, 131, ... on, rather than having period 4^(k-1) from term k on. - M. F. Hasler, Sep 26 2022

Examples

			The array is constructed along its antidiagonals, in the following way:
  a(1)  a(3)  a(6)  a(10)
  a(2)  a(5)  a(9)
  a(4)  a(8)
  a(7)
See the link from Peter Kagey for an animated example.
The beginning of the square array is:
   1,  3,  2,  6,  4,  5, 10, 11, 13,  8, 14, 18,  7, 20, 19,  9, 12, ...
   2,  4,  5,  1,  8,  3,  6, 12, 14, 16,  7, 15, 17,  9, 22, 21, 11, ...
   3,  1,  6,  2,  9,  7,  5,  4, 15, 17, 12, 19, 18, 21,  8, 10, 23, ...
   4,  2,  3,  5,  1,  8,  9,  7, 16,  6, 18, 17, 11, 10, 23, 22, 14, ...
   5,  7,  1,  4,  2,  6,  3, 15,  9, 10, 13,  8, 20, 14, 12, 11, 17, ...
   6,  8,  9,  7,  5, 10,  4, 16,  2,  1,  3, 11, 22, 15, 24, 13, 27, ...
   7,  5,  4,  3,  6, 14,  8,  9, 11, 18,  2, 21,  1, 16, 10, 12, 20, ...
   8,  6,  7,  9, 11,  4, 13,  3, 12, 15,  1, 10,  2,  5, 26, 14, 18, ...
   9, 11,  8, 10,  3,  1, 14,  6,  7, 13,  4, 12, 24, 18,  2,  5, 19, ...
  10, 12, 13, 11, 16,  2, 17,  5, 20,  9,  8, 14,  4,  6,  1,  7,  3, ...
  11,  9, 14, 12, 10, 15,  1,  8, 21,  7, 16, 20,  5,  3, 18, 17, 32, ...
  12, 10, 11,  8,  7,  9,  2, 13,  5, 23, 25, 26, 14, 17, 16, 15, 33, ...
...
  - _N. J. A. Sloane_, Jun 29 2016
		

Crossrefs

First 4 rows are A274315, A274316, A274317, A274791.
Main diagonal is A274318.
Column 1 is A000027, column 2 is A256008(n) = A004443(n-1)+1 = 1 + (nimsum of n-1 and 2), column 3 is A274614 (or equally, A274615 + 1), and column 4 is A274617 (or equally, A274619 + 1).
Antidiagonal sums give A274530. Other properties of antidiagonals: A274529, A275883.
Cf. A274080 (used in Haskell program), A274616.
A065188 and A065189 say where the 1's appear in successive columns and rows.
If all terms are reduced by 1 and the offset is changed to 0 we get A274528.
A274650 and A274651 are triangles in the shape of a right triangle and with a similar definition.
See A274630 for the case where both queens' and knights' moves must avoid duplicates.

Programs

  • Haskell
    import Data.List ((\\))
    a269526 n = head $ [1..] \\ map a269526 (a274080_row n)
    -- Peter Kagey, Jun 10 2016
    
  • Maple
    # The following Maple program was provided at my request by Alois P. Heinz, who said that he had not posted it himself because it stores the data in an inefficient way. - N. J. A. Sloane, Jul 01 2016
    A:= proc(n, k) option remember; local m, s;
             if n=1 and k=1 then 1
           else s:= {seq(A(i,k), i=1..n-1),
                     seq(A(n,j), j=1..k-1),
                     seq(A(n-t,k-t), t=1..min(n,k)-1),
                     seq(A(n+j,k-j), j=1..k-1)};
                for m while m in s do od; m
             fi
         end:
    [seq(seq(A(1+d-k, k), k=1..d), d=1..15)];
  • Mathematica
    A[n_, k_] := A[n, k] = If[n == 1 && k == 1, 1, s = {Table[A[i, k], {i, 1, n-1}], Table[A[n, j], {j, 1, k-1}], Table[A[n-t, k-t], {t, 1, Min[n, k] - 1}], Table[A[n+j, k-j], {j, 1, k-1}]} // Flatten; For[m = 1, True, m++, If[FreeQ[s, m], Return[m]]]];
    Table[Table[A[1+d-k, k], {k, 1, d}], {d, 1, 15}] // Flatten (* Jean-François Alcover, Jul 21 2016, translated from Maple *)
  • PARI
    {M269526=Map(); A269526=T(r,c)=c>1 && !mapisdefined(M269526, [r,c], &r) && mapput(M269526, [r,c], r=sum(k=1, #c=Set(concat([[T(r+k,c+k)|k<-[1-min(r, c)..-1]], [T(r,k)|k<-[1..c-1]], [T(k,c)|k<-[1..r-1]], [T(r+c-k,k)|k<-[1..c-1]]])), c[k]==k)+1); r} \\ M. F. Hasler, Sep 26 2022

Formula

Theorem 1: T(n,1) = n.
Proof by induction. T(1,1)=1 by definition. When calculating T(n,1), the only constraint is that it be different from all earlier entries in the first column, which are 1,2,3,...,n-1. So T(n,1)=n. QED
Theorem 2 (Based on a message from Bob Selcoe, Jun 29 2016): Write n = 4t+i with t >= 0, i=1,2,3, or 4. Then T(n,2) = 4t+3 if i=1, 4t+4 if i=2, 4t+1 if i=3, 4t+2 if i=4. This implies that the second column is the permutation A256008.
Proof: We check that the first 4 entries in column 2 are 2,5,6,3. From then on, to calculate the entry T(n,2), we need only look to the N, NW, W, and SW (we need never look to the East). After we have found the first 4t entries in the column, the column contains all the numbers from 1 to 4t. The four smallest free numbers are 4t+1, 4t+2, 4t+3, 4t+4. Entry T(4t+1,2) cannot be 4t+1 or 4t+2, but it can (and therefore must) be 4t+3. Similarly T(4t+2,2)=4t+4, T(4t+3,2)=4t+1, and T(4t+4,2)=4t+2. The column now contains all the numbers from 1 to 4t+4. Repeating this argument established the theorem. QED
Comments from Bob Selcoe, Jun 29 2016: (Start)
From Theorem 2, column 2 (i.e., terms a((j^2+j+4)/2), j>=1) is a permutation. After a(3)=3, the differences of successive terms follow the pattern a(n) = 3 [+1, -3, +1, +5], so a(5)=4, a(8)=1, a(12)=2, a(17)=7, a(23)=8, a(30)=5...
Similarly, column 3 (i.e., terms a((j^2+j+6)/2), j>=2) appears to be a permutation, but with the pattern after a(6)=2 and a(9)=5 being 5 [+1, -3, -2, +8, -5, +3, +1, +5, +1, -3, +1, -2, +8, -3, +1, +5]. (See A274614 and A274615.)
I conjecture that other similar cyclical difference patterns should hold for any column k (i.e., terms a((j^2+j+2*k)/2), j>=k-1), so that each column is a permutation.
Also, the differences in column 1 are a 1-cycle ([+1]), in column 2 a 4-cycle after the first term, and in column 3 a 16-cycle after the second term. Perhaps the cycle lengths are 4^(k-1) starting after j=k-1. (End) WARNING: These comments may be wrong - see COMMENTS section. - N. J. A. Sloane, Sep 26 2022

Extensions

Definition clarified by Omar E. Pol, Jun 29 2016

A274318 Main diagonal of infinite Sudoku-type array A269526.

Original entry on oeis.org

1, 4, 6, 5, 2, 10, 8, 3, 7, 9, 16, 26, 29, 22, 20, 23, 28, 38, 12, 32, 46, 13, 14, 11, 15, 56, 35, 58, 47, 48, 24, 18, 21, 69, 17, 52, 41, 19, 82, 83, 70, 25, 30, 62, 93, 27, 65, 106, 78, 102, 37, 110, 112, 76, 116, 119, 92, 31, 34, 49, 39, 101, 33, 36, 138
Offset: 1

Views

Author

N. J. A. Sloane, Jun 29 2016

Keywords

Comments

Conjectured to be a permutation of the natural numbers.

Crossrefs

Programs

  • Mathematica
    A[n_, k_] := A[n, k] = If[n == 1 && k == 1, 1, s = {Table[A[i, k], {i, 1, n - 1}], Table[A[n, j], {j, 1, k - 1}], Table[A[n - t, k - t], {t, 1, Min[n, k] - 1}], Table[A[n + j, k - j], {j, 1, k - 1}]} // Flatten; For[m = 1, True, m++, If[FreeQ[s, m], Return[m]]]];
    a[n_] := A[n, n];
    Array[a, 65] (* Jean-François Alcover, Jun 10 2017, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Jun 29 2016

A274316 Second row of infinite Sudoku-type array A269526.

Original entry on oeis.org

2, 4, 5, 1, 8, 3, 6, 12, 14, 16, 7, 15, 17, 9, 22, 21, 11, 25, 10, 27, 28, 30, 32, 34, 13, 37, 39, 36, 18, 19, 43, 42, 38, 46, 40, 44, 51, 53, 23, 20, 56, 50, 49, 54, 59, 58, 52, 24, 55, 62, 26, 63, 72, 74, 71, 65, 73, 76, 78, 29, 31, 79, 86, 83, 84, 33, 35, 90, 88, 93, 91, 95, 99, 97, 100, 94
Offset: 1

Views

Author

N. J. A. Sloane, Jun 29 2016

Keywords

Crossrefs

A274317 Third row of infinite Sudoku-type array A269526.

Original entry on oeis.org

3, 1, 6, 2, 9, 7, 5, 4, 15, 17, 12, 19, 18, 21, 8, 10, 23, 22, 11, 14, 13, 31, 33, 35, 36, 16, 34, 41, 43, 42, 38, 40, 45, 47, 27, 20, 52, 49, 54, 50, 57, 46, 59, 58, 24, 55, 63, 56, 26, 65, 25, 71, 73, 67, 28, 70, 75, 29, 32, 30, 72, 85, 80, 82, 86, 91, 89, 87, 92, 90, 94, 93, 37, 95, 39, 99
Offset: 1

Views

Author

N. J. A. Sloane, Jun 29 2016

Keywords

Crossrefs

A295563 First row of array in A274528.

Original entry on oeis.org

0, 2, 1, 5, 3, 4, 9, 10, 12, 7, 13, 17, 6, 19, 18, 8, 11, 23, 25, 22, 24, 28, 15, 14, 34, 30, 37, 39, 36, 38, 40, 16, 42, 41, 46, 45, 44, 51, 26, 20, 21, 50, 57, 52, 59, 49, 55, 61, 63, 62, 66, 65, 67, 72, 71, 58, 73, 27, 76, 75, 69, 70, 29, 86, 31, 82, 83, 32, 33, 88, 87, 91, 90, 35, 97, 92, 95
Offset: 0

Views

Author

N. J. A. Sloane, Nov 29 2017

Keywords

Comments

Note this is not a list, this gives the Grundy-value at (0,n) of the Lonely Queens array A274528 regarded as a game.
It would be nice to have a formula or recurrence. Note that the first row of the analogous array corresponding to the Wythoff game, A004482, does have a simple formula.
The points seem to fall on or close to two lines, of slopes about 0.48 and 1.29 (what are these slopes?). See A295564, A295565, A295566, A295567 for the X- and Y-coordinates of the points on the two lines.

Crossrefs

Programs

  • PARI
    See Links section.

A273138 Row number in which n appears for the first time in the infinite Sudoku-type array A269526.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jul 02 2016

Keywords

Comments

It appears that in the square array A269526 the numbers generally appear for the first time in or near the first few rows.

Examples

			Diagram with the first 18 positive integers located in the position where they appear for first time in the square array A269526:
1, 3, -, 6, -, -, 10, 11, 13, -,  -, 18,
2, 4, 5, -, 8, -,  -, 12, 14, 16, -,
-, -, -, -, 9, -,  -,  -, 15, 17,
-, -, -, -, -, -,  -,  -,  -,
-, 7, -, -, -, -,  -,  -,
-, -, -, -, -, -,  -,
-, -, -, -, -, -,
-, -, -, -, -,
-, -, -, -,
-, -, -,
-, -,
-,
...
a(9) = 3 because in the square array A269526 the number 9 appears for the first time in the third row.
a(n) <= 6, for n = 1..80.
		

Crossrefs

First three rows in the square array A269526 are A274315, A274316, A274317.

A274791 Fourth row of infinite Sudoku-type array A269526.

Original entry on oeis.org

4, 2, 3, 5, 1, 8, 9, 7, 16, 6, 18, 17, 11, 10, 23, 22, 14, 12, 13, 15, 26, 32, 30, 19, 37, 35, 36, 42, 38, 40, 27, 44, 20, 21, 50, 47, 46, 51, 52, 49, 48, 53, 24, 55, 54, 59, 61, 25, 58, 64, 70, 28, 62, 31, 29, 72, 69, 74, 68, 78, 84, 33, 34, 85, 90, 88, 93, 91, 94, 86, 98, 96, 39, 99, 101, 103, 41, 107
Offset: 1

Views

Author

Omar E. Pol, Jul 06 2016

Keywords

Crossrefs

First 20 terms taken from the Example section of A269526.

Programs

  • PARI
    See Links section.
Showing 1-7 of 7 results.