OFFSET
0,2
COMMENTS
In the x-y plane, lengths of line segments between lattice points P1=(x1,y1) with 0 <= (x1,y1) <= n and lattice points P2=(x2,y2) with -n <= (x2,y2) <= 0.
EXAMPLE
For n=1, distances P1 to P2 can take 5 distinct nonzero values, whose squared distances are {1,2,4,5,8}, so a(1)=5.
MAPLE
segments := proc (n)
local rr, x1, y1, x2, y2, sqDist;
rr := {};
for x1 from 0 to n do for y1 from 0 to n do
for x2 from 0 by -1 to -n do for y2 from 0 by -1 to -n do
sqDist := (x1-x2)^2+(y1-y2)^2;
if 0 < sqDist then rr := {op(rr), sqDist} end if;
end do end do
end do end do;
return rr
end proc:
qq:=[seq(nops(segments(n)), n=0..20)]
CROSSREFS
KEYWORD
nonn
AUTHOR
César Eliud Lozada, Mar 15 2019
EXTENSIONS
a(31)-a(48) from Jon E. Schoenfield, Apr 03 2019
STATUS
approved