While experimenting with the polygon unction in desmos, I found a interesting problem. However, due to my lack of knowledge in analytic geometry I decided to summarize the problem here. This graph is useful for visualizing the problem: https://www.desmos.com/calculator/xqb9njfxd9 P.S. First time hope I can provide interesting problem that maybe is original, but I'm not too familiar with formatting/LaTeX
Setup
Consider the points $(0,0)$, $(x_1,y_1)$, and $(x_2,y_2)$ or point $A$, $B$, and $C$ respectively
Said points form $\triangle ABC$ and $x_1$, $y_1$, $x_1$, and $y_1$ $ \in \mathbb {Z^+}$
$p$ is defined as the perimeter of $\triangle ABC$ which can be calculated by the following cartesian equation:
$$p=\sqrt{x_{1}^{2}+y_{1}^{2}}+\sqrt{x_{2}^{2}+y_{2}^{2}}+\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}$$
$D$ is a list defined by the points ${D_1...D_d}$ all of which must be within $\mathbb {Z}$ and contained inside $\triangle ABC$ (excludes the dots that lie along the perimeter of the triangle).
$d$ is the length of the list $D$ and can be formulated into the equation:
$$d=\frac{x_{1}y_{2}-x_{2}y_{1}+2-\gcd\left(x_{1}-x_{2},y_{2}-y_{1}\right)-\gcd\left(x_{2},y_{2}\right)-\gcd\left(x_{1},y_{1}\right)}{2}$$
Problem
Given any value of $d \in \mathbb {Z^+} $ find a triangle $\triangle ABC$ with lowest perimeter as defined by $p$
In other words, find a function $f(x)$ where $x$ is the amount of dots and $f(x)$ is the minimum perimeter needed to contain $x$ amount of dots.
If such a function cannot exist (of which I do not know), prove it.