login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Diagonal indices of Greedy Queens (see A065188).
6

%I #12 Oct 03 2016 17:50:11

%S 0,-1,2,-2,1,-3,4,-4,3,6,-5,-6,5,-7,8,7,-8,-9,10,-10,9,12,-11,-12,11,

%T 13,-13,-14,15,-15,16,-16,17,14,-17,-18,19,18,-19,-20,21,22,-21,-22,

%U 23,20,-23,-24,24,-25,25,26,-26,27,-27,-28,29,-29,30,-30,28,31

%N Diagonal indices of Greedy Queens (see A065188).

%C a(n) is the index of the diagonal of the n-th queen. The main diagonal has index 0, upper (lower) diagonals have positive (negative) indices.

%H Alois P. Heinz, <a href="/A276325/b276325.txt">Table of n, a(n) for n = 1..10000</a>

%F Equals A275901 - A275902.

%e The first queen is in the main diagonal, the second queen is in the first lower diagonal, the third queen is in the second upper diagonal, ... :

%e :

%e : Q\\\\ ...

%e : \\\Q\ ...

%e : \Q\\\ ...

%e : \\\\Q ...

%e : \\Q\\ ...

%e : \\\\\ ...

%e : .....

%p # Maple program from _N. J. A. Sloane_, Oct 03 2016

%p # To get 10000 terms of A275902 (xx), A275901 (yy), A276783 (ss), -A276325 (dd)

%p M1:=100000; M2:=22000; M3:=10000;

%p xx:=Array(0..M1,0); yy:=Array(0..M1,0); ss:=Array(0..M1,0); dd:=Array(0..M1,0);

%p xx[0]:=0; yy[0]:=0; ss[0]:=0; dd[0]:=0;

%p for n from 1 to M2 do

%p sw:=-1;

%p for s from ss[n-1]+1 to M2 do

%p for i from 0 to s do

%p x:=s-i; y:=i;

%p if not member(x,xx,'p') and

%p not member(y,yy,'p') and

%p not member(x-y,dd,'p') then sw:=1; break; fi;

%p od: # od i

%p if sw=1 then break; fi;

%p od: # od s

%p if sw=-1 then lprint("error, n=",n); break; fi;

%p xx[n]:=x; yy[n]:=y; ss[n]:=x+y; dd[n]:=x-y;

%p od: # od n

%p [seq(xx[i],i=0..M3)]:

%p [seq(yy[i],i=0..M3)]:

%p [seq(ss[i],i=0..M3)]:

%p [seq(dd[i],i=0..M3)]:

%Y Cf. A065188, A276324, A275901, A275902.

%K sign

%O 1,3

%A _Alois P. Heinz_, Aug 30 2016