OFFSET
1,6
EXAMPLE
a(12) = 3 since the twelfth point in distance from the origin is (3,3) at a distance of 3*sqrt(2) = 4.242640... whereas the eleventh is (4,1) at a distance of sqrt(17) = 4.12310... and the thirteenth is (4,2) at a distance of 2*sqrt(5) = 4.472113... .
The fourteenth and fifteenth points are respectively (5,0) and (4,3) and have the same distance 5 to the origin, but (5,0) has a smaller ordinate than (4,3), so a(14) = 0 and a(15) = 3.
MATHEMATICA
xmax = 20; (* Maximum explorative abscissa *)
(* t are points in the triangle of vertices (0, 0), (0, max) and (xmax, xmax) *)
t = Flatten[Table[{x, y}, {x, 0, xmax}, {y, 0, x}], 1];
nmax = Floor[xmax^2/4] (* Safe limit for correctly sorted sequence *)
Transpose[SortBy[t, {#[[1]]^2 + #[[2]]^2 &, #[[2]] &}]][[2]][[1 ;;
nmax]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v and Andres Cicuttin, Dec 31 2016
STATUS
approved