[go: up one dir, main page]

login
Search: a274631 -id:a274631
     Sort: relevance | references | number | modified | created      Format: long | short | data
Square array T(n,k) (n>=1, k>=1) read by antidiagonals upwards in which the number entered in a square is the smallest positive number that is different from the numbers already filled in that are queens' or knights' moves away from that square.
+10
7
1, 2, 3, 4, 5, 6, 3, 7, 8, 2, 5, 1, 9, 4, 7, 6, 2, 10, 11, 1, 5, 7, 4, 12, 6, 3, 9, 8, 8, 9, 11, 13, 2, 10, 6, 4, 10, 12, 1, 3, 4, 7, 13, 11, 9, 9, 6, 2, 5, 8, 1, 12, 14, 3, 10, 11, 13, 3, 7, 6, 14, 9, 5, 1, 12, 15, 12, 8, 4, 14, 9, 11, 10, 3, 15, 2, 7, 13, 13, 10, 5, 1, 12, 15, 2, 16, 6, 4, 8, 14, 11
OFFSET
1,2
COMMENTS
If we only worry about queens' moves then we get the array in A269526.
Presumably, as in A269526, every column, every row, and every diagonal is a permutation of the natural numbers.
The knights only affect the squares in their immediate neighborhood, so this array will have very similar properties to A269526. The most noticeable difference is that the first column is no longer A000027, it is now A274631.
A piece that can move like a queen or a knight is known as a Maharaja. If we subtract 1 from the entries here we obtain A308201. - N. J. A. Sloane, Jun 30 2019
LINKS
EXAMPLE
The array begins:
1, 3, 6, 2, 7, 5, 8, 4, 9, 10, 15, 13, 11, 18, 12, 20, 16, 22, ...
2, 5, 8, 4, 1, 9, 6, 11, 3, 12, 7, 14, 17, 15, 10, 13, 19, 24, ...
4, 7, 9, 11, 3, 10, 13, 14, 1, 2, 8, 5, 6, 16, 22, 17, 21, 12, ...
3, 1, 10, 6, 2, 7, 12, 5, 15, 4, 16, 20, 13, 9, 11, 14, 25, 8, ...
5, 2, 12, 13, 4, 1, 9, 3, 6, 11, 10, 17, 19, 8, 7, 15, 23, 29, ...
6, 4, 11, 3, 8, 14, 10, 16, 13, 1, 2, 7, 15, 5, 24, 21, 9, 28, ...
7, 9, 1, 5, 6, 11, 2, 12, 8, 14, 3, 21, 23, 22, 4, 27, 18, 30, ...
8, 12, 2, 7, 9, 15, 1, 19, 4, 5, 6, 10, 18, 3, 26, 23, 11, 31, ...
10, 6, 3, 14, 12, 4, 5, 9, 11, 7, 1, 8, 16, 13, 2, 24, 28, 20, ...
9, 13, 4, 1, 10, 2, 7, 18, 12, 3, 17, 19, 24, 14, 20, 5, 8, 6, ...
11, 8, 5, 9, 13, 3, 15, 1, 2, 6, 20, 18, 10, 4, 17, 7, 12, 14, ...
12, 10, 7, 18, 11, 6, 4, 8, 14, 9, 5, 15, 21, 2, 16, 26, 3, 13, ...
13, 15, 17, 12, 14, 16, 18, 7, 10, 22, 11, 3, 8, 19, 23, 9, 2, 1, ...
14, 11, 19, 8, 5, 20, 3, 2, 16, 13, 12, 25, 4, 10, 6, 18, 7, 15, ...
16, 18, 21, 10, 15, 13, 11, 17, 5, 8, 9, 6, 7, 30, 25, 28, 20, 19, ...
15, 20, 13, 17, 16, 12, 19, 6, 7, 24, 18, 11, 28, 23, 14, 22, 5, 36, ...
17, 14, 22, 19, 18, 8, 20, 10, 23, 15, 4, 1, 3, 24, 13, 16, 33, 9, ...
18, 16, 23, 24, 25, 26, 14, 13, 17, 19, 22, 9, 5, 6, 8, 10, 15, 27, ...
...
Look at the entry in the second cell in row 3. It can't be a 1, because the 1 in cell(1,2) is a knight's move away, it can't be a 2, 3, 4, or 5, because it is adjacent to cells containing these numbers, and there is a 6 in cell (1,3) that is a knight's move away. The smallest free number is therefore 7.
MAPLE
# Based on Alois P. Heinz's program for A269526
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)};
# add knights moves
if n >= 3 then s:={op(s), A(n-2, k+1)}; fi;
if n >= 3 and k >= 2 then s:={op(s), A(n-2, k-1)}; fi;
if n >= 2 and k >= 3 then s:={op(s), A(n-1, k-2)}; fi;
if k >= 3 then s:={op(s), A(n+1, k-2)}; fi;
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] = Module[{m, s}, If[n==1 && k==1, 1, s = Join[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}]] // Union; If[n >= 3, AppendTo[s, A[n-2, k+1]] // Union ]; If[n >= 3 && k >= 2, AppendTo[s, A[n-2, k-1]] // Union]; If[n >= 2 && k >= 3, AppendTo[s, A[n-1, k-2]] // Union]; If[k >= 3, AppendTo[s, A[n+1, k-2]] // Union]; For[m = 1, MemberQ[s, m], m++]; m]]; Table[A[1+d-k, k], {d, 1, 15}, {k, 1, d}] // Flatten (* Jean-François Alcover, Mar 14 2017, translated from Maple *)
CROSSREFS
For first column, row, and main diagonal see A274631, A274632, A274633.
See A308883 for position of 1 in column n.
See A308201 for an essentially identical array.
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane following a suggestion from Joseph G. Rosenstein, Jul 07 2016
STATUS
approved
Sprague-Grundy values for Maharaja Nim on an infinite single-quadrant board scanned by upwards antidiagonals.
+10
6
0, 1, 2, 3, 4, 5, 2, 6, 7, 1, 4, 0, 8, 3, 6, 5, 1, 9, 10, 0, 4, 6, 3, 11, 5, 2, 8, 7, 7, 8, 10, 12, 1, 9, 5, 3, 9, 11, 0, 2, 3, 6, 12, 10, 8, 8, 5, 1, 4, 7, 0, 11, 13, 2, 9, 10, 12, 2, 6, 5, 13, 8, 4, 0, 11, 14, 11, 7, 3, 13, 8, 10, 9, 2, 14, 1, 6, 12, 12, 9
OFFSET
0,3
COMMENTS
A Maharaja combines the moves of a queen and a knight.
If we add 1 to every term we get A274630.
LINKS
Urban Larsson and Johan Wästlund, Maharaja Nim: Wythoff’s Queen meets the Knight, arXiv 1207.0765 [math.CO], 2012.
Urban Larsson and Johan Wästlund, Maharaja Nim: Wythoff’s Queen meets the Knight, Integers: Electronic Journal of Combinatorial Number Theory 14 (2014), #G05.
Rémy Sigrist, Colored representation of the first 1000 antidiagonals (where the hue is function of T(x,y) and black pixels correspond to 0's)
EXAMPLE
The Sprague-Grundy values are as follows (this shows the first 7 antidiagonals):
0, 2, 5, 1, 6, 4, 7, ...
1, 4, 7, 3, 0, 8, ...
3, 6, 8, 10, 2, ...
2, 0, 9, 5, ...
4, 1, 11, ...
5, 3, ...
6, ...
...
PROG
(PARI) See Links section.
CROSSREFS
Cf. A307282.
For the positions of the 0's, see A307281.
The top row of the array is A308882 (or A274632 - 1).
The leading column is A274631 - 1, the main diagonal is A274633 - 1.
A274630 is essentially the same sequence (but with 1 added to every term).
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Jun 30 2019
EXTENSIONS
More terms from Rémy Sigrist, Jun 30 2019
STATUS
approved

Search completed in 0.008 seconds