Pythagorean Type Equation $4a^2+b^2=2c^2$ where $a$, $b$ and $c$ are positive integers.
I have to find all primitive triplets such that $c \le N$. $N$ can be as high as $10^7$. Can we get a tree like solutions like that of pythagorean triplets, which efficiently generate only the primitive solutions?
If $(p,q,r)$ is a primitive solution, then $(p,3q+4r,2q+3r)$ is also a primitive solution.
EDIT:
In this case the whole square triplet form arithmetic progression. What if this is not the case? For example how to solve $a^2+3b^2=c^2$?
 A: This answer addresses the question as originally posted, relating to the equation $4a^2+b^2=2c^2$ only.
Putting $d=2a$ we have $d^2+b^2=2c^2$, implying that $b^2,c^2,d^2$ are in arithmetic progression.
Formulae for generating sets of three squares in arithmetic progression with no common divisor (due to Leonardo of Pisa (Fibonacci)) may be found here.  The formulae are in terms of parameters $m,n$ which must be coprime yielding two cases: a) one even, one odd; b) both odd.  
For case (a) the formulae are: $m^2+2mn-n^2, m^2+n^2, n^2+2mn-m^2$. This yields odd values so would produce a non-integer value for $a = d/2$.
For case (b) the above formulae yield even values so they must be divided by $2$ to yield coprime values.  For our purposes, however, we do not need $b,c,d$ to be coprime; the requirement is for $a,b,c$ to be coprime. So the formulae we require are:
$$a=\frac{d}{2}=\frac{m^2+2mn-n^2}{2}$$
$$c=m^2+n^2$$
$$b=n^2+2mn-m^2$$
Note that $a$ must be odd since $m^2+2mn-n^2\equiv1+2-1 \equiv 2$ mod $4$.
For some values of $m,n$, these formulae will yield a negative value for $a$ or $b$. To ensure positive values therefore the complete solution is:
$$a=\Bigg\lvert\frac{m^2+2mn-n^2}{2}\Bigg\rvert$$
$$b=\lvert n^2+2mn-m^2\rvert$$
$$c=m^2+n^2$$
