We have the following relations:
$$P=a+b+c,\quad 2A=ab,\quad a^2+b^2=c^2$$
In fact, there is one more that is implicit: the triangle inequality $a+b>c$ (which follows from $a^2+b^2=c^2$). We wish to relate the first and second relations, and so after staring at the problem for a while we realize the correct course of action is to multiply $P$ by $a+b-c$ (the latter guaranteed to be positive by the triangle inequality). This gives:
$$\begin{align}P(a+b-c)&=(a+b+c)(a+b-c)=(a+b)^2-c^2\\
&=a^2+b^2+2ab-c^2=2ab=4A
\end{align}$$
Hence in general for a right triangle we have $k=A/P=(a+b-c)/4$, so the question boils down to when the difference between the sum of the lengths of the legs and the length of the hypothenuse divides or is divisible by $4$, for a right triangle with integer side-lengths.
Here we actually need to generate pythagorean triples $(a,b,c)$ such that $a,b,c$ are integers and $a^2+b^2=c^2$; the wikipedia page here gives a good picture of Euclid's formula that I recommend thinking through. Euclid's formula is the following:
$$a=m^2-n^2,\quad b=2mn\quad c=m^2+n^2$$ for integers $m>n$.
Then the quantity $a+b-c$ is $m^2-n^2+2mn-m^2-n^2=2n(m-n)$, so $A/P=k=n(m-n)/2$. The options are now that either $2$ divides $n$ or $2$ divides $m-n$, so we either have $n=2d$ and $m=k/d+2d$ or $n=d$ and $m=2(k/d)+d$ for divisors $d$ of $k$.
(to get $P/A=k$ we need $2n(m-n)$ to divide $4$, so $n(m-n)$ must divide $2$, thus $n=1$, $m=2$, $n=1$, $m=3$, and $n=2$, $m=3$ are the only solutions, giving us $(3,4,5)$, $(8,6,10)$, $(5,12,13)$ with $k=2,1,2$ being the only possibilities).
I am deeply indebted to a French friend for his help.
\begin{align*}
\begin{cases}
x=3 t^7+7 t^6+\,\,\,3 t^5+19 t^4-15 t^3+37 t^2+9 t+1\\
y=\,\,\,t^7-9 t^6+37 t^5+15 t^4+19 t^3-\,\,\,3 t^2+7 t-3\\
\alpha=\,\,\,t^7+9 t^6+37 t^5-15 t^4+19 t^3+\,\,\,3 t^2+7 t+3\\
\beta=3 t^7-7 t^6+\,\,\,3 t^5-19 t^4-15 t^3-37 t^2+9 t-1
\end{cases}
\end{align*}
(a^2 + b^2)^2 + (2 a*b)^2 - (c^2 + d^2)^2 - (2 c*d)^2 /. {
a -> 3 m^7 + 7 m^6 n + 3 m^5 n^2 + 19 m^4 n^3
- 15 m^3 n^4 +37 m^2 n^5 + 9 m*n^6 + n^7,
b -> m^7 - 9 m^6 n + 37 m^5 n^2 + 15 m^4 n^3
+ 19 m^3 n^4 - 3 m^2 n^5 + 7 m*n^6 - 3 n^7,
c -> m^7 + 9 m^6 n + 37 m^5 n^2 - 15 m^4 n^3
+ 19 m^3 n^4 + 3 m^2 n^5 + 7 m*n^6 + 3 n^7,
d -> 3 m^7 - 7 m^6 n + 3 m^5 n^2 - 19 m^4 n^3
- 15 m^3 n^4 - 37 m^2 n^5 + 9 m*n^6 - n^7} // FullSimplify
Best Answer
I considered this problem in the following paper
"TWO EXTREME DIOPHANTINE PROBLEMS CONCERNING THE PERIMETER OF PYTHAGOREAN TRIANGLES"
in the journal Glasnik Matematicki, Vol. 46, No.1 (2011), 1-5.
I showed that no such triangles exist.