First of all we will prove that the points P1,P2,…,Pn are concyclic. Let Pi have coordinates (xi,yi) for i=1,2,…,n and consider the point O=(u,v) where u=(x1+x2+⋯+xn)/n and v=(y1+y2+⋯+yn)/n. Then
OPi2=(u−xi)2+(v−yi)2=(nx1+x2+⋯+xn−xi)2+(ny1+y2+⋯+yn−yi)2=u2+v2+xi2+yi2−n2(xi(x1+x2+⋯+xn)+yi(y1+y2+⋯+yn))
Since the sum P1Pi2+P2Pi2+⋯+PnPi2 does not depend on i and the sum
(xi−x1)2+(yi−y1)2+(xi−x2)2+(yi−y2)2+⋯+(xi−xn)2+(yi−yn)2
also does not depend on i. Hence
n(xi2+yi2)−2xi(x1+x2+⋯+xn)−2yi((y1+y2+⋯+yn)=n⋅(OPi2−u2−v2)
does not depend on i. Thus OPi2 does not depend on i. Consequently OP1=OP2=⋯=OPn and hence the points P1,P2,…,Pn lie on a circle with center O. W.l.o.g. we will assume that the points P1,P2,…,Pn are placed on a circle in a clockwise order. Let the smallest positive integer in the sequence P1Pi,P2Pi,…,PnPi be a and let the second smallest one be b.

Now, consider three consecutive points on the circle Pi−1,Pi,Pi+1 and a point Pk which is different from these three points. By Lemma 1, min{Pi−1Pi,PiPi+1}≤PiPk where Pn+1=P1. Hence min{Pi−1Pi,PiPi+1}=a for all i=1,2,…,n. There are two cases: If a=b, then consider a point Pi. We know that either Pi−1Pi=a or PiPi+1=a. W.l.o.g., assume that Pi−1Pi=a. Since b=a, there must be another point Pk such that PiPk=b=a. We claim that k=i+1. If not, consider the cyclic quadrilateral Pi−1PiPi+1Pk. Since 90∘>90∘−∠Pi−1PiPk/2=∠PiPi−1Pk=180∘−∠PiPi+1Pk, we get that ∠PiPi+1Pk>90∘ and hence a=PiPk>PiPi+1 which contradicts to the choice of a. Hence k=i+1 and since this result is true for all i, we conclude that the PiPi+1=a for all i=1,2,…,n so these n points form a regular n-gon.

If a<b, then exactly one of Pi−1Pi and PiPi+1 is equal to a and hence n must be even and exactly n/2 of the sides of the n-gon P1P2…Pn must be equal to a and none of these sides are consecutive. We claim that all other n/2 sides must be equal to b. Consider the four consecutive points Pi−1PiPi+1Pi+2 such that PiPi+1=a. By Lemma 1 min{Pi−1Pi+1,Pi+1Pi+2}=b and similarly min{Pi−1Pi,PiPi+2}=b. If PiPi−1=Pi−1Pi+1=b or PiPi+2=Pi+2Pi+1=b then we would obtain that b<a which is a contradiction. Hence either PiPi−1=Pi+1Pi+2=b or PiPi+2=Pi−1Pi+1=b which shows that the quadrilateral Pi−1PiPi+1Pi+2 is a isosceles trapezoid and hence Pi−1Pi=Pi+1Pi+2. Thus, all other n/2 sides are equal to b.

greatest common divisor of all these distances is 1. Consider the cyclic quadrilaterals A1A2Ak+1Ak+2 and let dk=A1Ak+1. By Ptolemy Theorem, we have dk2=d12+dk−1dk+1. If d1>1 then let p be a prime divisor of d1. Since d22=d12+d1d3 we get that p also divides d2 and using the equations dk2=d12+dk−1dk+1 we can inductively prove that p divides all di's which is a contradiction. Hence d1=1 but in this case A1A2=A2A3=1 and hence by triangle inequality, d2=A1A3<1+1=2 and hence d2=1. On the other hand, d22=d12+d1d3 which is impossible since we would get that d3=0. Done.

Now, if a=b, since we have a regular n-gon by Lemma 2 all possibilities are: n=1,2,3. If a<b, since n is even the side lengths are of the form a,b,a,b,…,a,b, the points with even (odd) indices form a regular n/2-gon and hence all possibilities are n=2,4,6 again by Lemma 2. For n=4, choose a rectangle with side lengths 3 and 4. For n=6 choose a cyclic hexagon with consecutive side lengths 3, 5, 3, 5, 3, 5. In this case all diagonals are integers and for all i, the distances PiPi+1,P2Pi+1,…,P6Pi forms the sequence 0, 3, 5, 7, 7, 8: