For two odd primes $pLet us fix two primes $p,q$ with $2<p<q$. How can we find positive integers $a,b$ which solve the equation $a^2+b^4=pq$ without brute force?
Interestingly there exist sometimes two solutions:

*

*$5\cdot13=7^2+2^4=8^2+1^4$

*$5\cdot821=3^2+8^4=53^2+6^4$

*$17\cdot113=25^2+6^4=36^2+5^4$
In more rare cases I even obtain three solutions, e.g.:

*

*$73\cdot89=49^2+8^4=64^2+7^4=79^2+4^4$
Is there a systematic way to obtain the solutions $a,b$ directly? Or at least, can we establish a relationship between the two primes and these natural solutions? I generated a CSV file containing some more cases, which maybe help in finding patterns or connections between $p,q$ and $a,b$.
Can we anticipate (state in advance) how many positive integer solutions we will get depending on $p,q$?
 A: With kind assistance I have received a useful hint for a direction to investigate, wich I would like to share with you all:
In the case that $p\equiv3\pmod4$ or $q\equiv3\pmod4$ no solution exist.
Let us set $p=r^2+s^2$ and $q=u^2+v^2$. If $p\equiv1\pmod4$ and $q\equiv1\pmod4$ we exactly obtain one solution $r>s>0$ for $p$ and one solution $u>v>0$ for $q$.
If we now have these unique solutions $p=r^2+s^2$ and $q=u^2+v^2$, then the product of both primes is $pq=(r^2+s^2)(u^2+v^2)=(ru+sv)^2+(rv-su)^2=(ru-sv)^2+(rv+su)^2$.
Consider $b^2=c$, other integer solutions for $pq=a^2+c^2=a^2+b^4$ do not exist, unless one of the four integers $ru+sv$, $|rv-su|$, $|ru-sv|$ and $rv+su$ is a perfect square.
To retrace what happens in practice, I generated variuos cases, where three solutions exist (feel free to download the CSV):

*

*$p\cdot q=233\cdot12409=256^2+41^4=1616^2+23^4=1681^2+16^4$

*$p\cdot q=89\cdot233=1^2+12^4=129^2+8^4=144^2+1^4$

*$p\cdot q=17\cdot4241=81^2+16^4=256^2+9^4=264^2+7^4$
In the first case we have $p=233=8^2+13^2$ and $q=12409=72^2+85^2$.
In the second case we have $p=89=5^2+8^2$ and $q=233=8^2+13^2$.
In the third case we have $p=17=1^2+4^2$ and $q=4241=4^2+65^2$.
Hypothetically, there could be four solutions, although so far I have only found these cases with a maximum of three solutions?
