A308880 Irregular array read by rows: row k (k>=1) contains k^2 numbers, formed by filling in a k X k square by rows so entries in all rows, columns, diagonals, antidiagonals are distinct, and then reading that square across rows.
0, 0, 1, 2, 3, 0, 1, 2, 2, 3, 0, 1, 4, 5, 0, 1, 2, 3, 2, 3, 0, 1, 1, 4, 5, 2, 5, 0, 1, 4, 0, 1, 2, 3, 4, 2, 3, 0, 1, 5, 1, 4, 5, 2, 0, 5, 0, 1, 4, 3, 3, 6, 7, 0, 1, 0, 1, 2, 3, 4, 5, 2, 3, 0, 1, 6, 7, 1, 4, 5, 2, 0, 8, 5, 0, 1, 4, 3, 6, 3, 7, 6, 0, 1, 4, 4, 2, 9, 5, 7, 10
Offset: 1
Examples
The first eight squares are (here A=10, B=11, C=12): 0 -------- 01 23 -------- 012 230 145 -------- 0123 2301 1452 5014 -------- 01234 23015 14520 50143 36701 -------- 012345 230167 145208 501436 376014 42957A -------- 0123456 2301674 1452083 5014362 3780145 4265798 9548237 -------- 01234567 23016745 14520836 50143628 37801459 42675983 9548237A A836BC92 -------- Concatenating the rows of these squares gives the sequence.
Links
- I. V. Serov, Rows of first 32 squares, flattened (There are 1^2+2^2+...+32^2 = 11440 entries.)
- F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52.
Programs
-
MATLAB
A308880 = []; A308881 = []; for n = 1:oo; M = [0:(n-1) zeros(n-1,n-0)*NaN]; for i = 2:n; for j = 1:n; M = Mnext(M,n,i,j); end; end A308880 = [A308880 reshape(M',1,n^2)]; A308881 = [A308881 reshape(M ,1,n^2)]; end function [M] = Mnext(M,n,i,j); row = M(i,1:j-1); col = M(1:i-1,j); dim = diag( M, j-i); dia = diag(fliplr(M),n-i-j+1); X = ([row col' dim' dia']); for m = 0:length(X)-1; if isempty(find(X==m)); break; end; end; M(i,j) = m; end % I. V. Serov, Jun 30 2019
Comments