Cardano triplet (source code)

= Cardano triplet
{c}

A <Cardano triplet> is a triple of <positive integers> $(a,b,c)$ satisfying
$$
\sqrt[3]{a+b\sqrt c}+\sqrt[3]{a-b\sqrt c}=1,
$$
with real <cube roots>. Put $u=\sqrt[3]{a+b\sqrt c}$ and $v=\sqrt[3]{a-b\sqrt c}$. Cubing $u+v=1$ gives $uv=(1-2a)/3$, and cubing that <product> yields the necessary <integer> identity
$$
27b^2c=(a+1)^2(8a-1).
$$
It is also sufficient. From this identity, the real <cube root> of $a^2-b^2c$ gives $uv=(1-2a)/3$. Therefore $s=u+v$ satisfies
$$
s^3=2a+(1-2a)s,\qquad(s-1)(s^2+s+2a)=0.
$$
Since $a\geq1$, the <quadratic polynomial> has negative <discriminant> $1-8a$ and no real <roots>. Hence $s=1$. This checks that cubing introduced no extraneous real solutions.

Reducing the <integer> identity <modulo> three forces $a\equiv2\pmod3$. Writing $a=3k-1$ for a <positive integer> $k$ then reduces it to $b^2c=k^2(8k-3)$. For example, $k=1$ gives $(a,b,c)=(2,1,5)$.