%N Sequence yielding an ordering of N*N derived from a family of recurrences. For any integer k define h(k,1)=1 and for n>1 define h(k,n)=h(k,n-1)+2*((-h(k,n-1)mod n)where "r mod s" denotes least nonnegative residue of r modulo s [informally, h(k,n) is got by "reflecting" h(k,n-1)in the least multiple of n that is >=h(k,n-1)]. Then for fixed k>=0 there are integers a(k), b(k), n(k) such that for all n>n(k) we have h(k,2*n+1)-h(k,2*n)=2*a(k)and h(k,2*n+2)-h(k,2*n+1)=2*b(k). For all k we have a(2*k+1)=a(2*k) and b(2*k+1)=1+b(2*k). Moreover b(2*k) is even for all k. The function k->(a(2*k),b(2*k)/2) is a bijection from the nonnegative integers N to N*N. It is "monotone" in the sense that k<=k' whenever a(2*k)<=a(2*k') and b(2*k)<=b(2*k'). The sequence given above is a(2*k).
%C The results on which the definition is based are not yet proved, but they are plausible and overwhelmingly supported by numerical evidence. I am working on a proof.
%C For each fixed n, k->h(k,n) is a bijection Z->Z (this is easy!). However for k<0 the sequence h(k,n) does not have the pseudo-periodic property we have used in defining a(k) and b(k).
%C n(k) appears to be O(sqrt k).
%e h(18,n) for n>=1 goes 18,18,18,22,28,32,38,42,48...so we can take n(18)=2, then 2*a(18)=28-22=38-32=48-42=...=6, so a(18)=3 and similarly b(18)=2.
%A _Alex Abercrombie_, Feb 15 2008