OFFSET
0,3
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..50000, Sep 13 2016 (First 1001 terms from Reinhard Zumkeller)
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.
N. J. A. Sloane, Maple program for A140100, A140101, A140102, A140103
FORMULA
MAPLE
See link.
MATHEMATICA
nmax = 100; y[0] = 0; x[1] = 1; y[1] = 2; x[n_] := x[n] = For[yn = y[n-1] + 1, True, yn++, For[xn = x[n-1] + 1, xn < yn, xn++, xx = Array[x, n-1]; yy = Array[y, n-1]; If[FreeQ[xx, xn | yn] && FreeQ[yy, xn | yn] && FreeQ[yy - xx, yn - xn] && FreeQ[yy + xx, yn - xn], y[n] = yn; Return[xn]]]];
Do[x[n], {n, 1, nmax}];
Join[{0}, yy - xx] (* Jean-François Alcover, Aug 01 2018 *)
PROG
(PARI) {X=[1]; Y=[2]; D=[1]; S=[3]; print1(Y[1]-X[1]", "); for(n=1, 100, for(j=2, 2*n, if(setsearch(Set(concat(X, Y)), j)==0, Xt=concat(X, j); for(k=j+1, 3*n, if(setsearch(Set(concat(Xt, Y)), k)==0, if(setsearch(Set(concat(D, S)), k-j)==0, if(setsearch(Set(concat(D, S)), k+j)==0, X=Xt; Y=concat(Y, k); D=concat(D, k-j); S=concat(S, k+j); print1(Y[ #X]-X[ #Y]", "); break); break))))))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jun 04 2008
EXTENSIONS
Terms computed by Reinhard Zumkeller.
Offset and initial term changed by N. J. A. Sloane, Oct 10 2016
STATUS
approved