The equation $x^3+d~y^3=1$ becomes $x^3\equiv 1$, mod $d$. Hence, PowerModList[1,1/3,d]
gives a list of all positive $x$ between 1 and $d-1$, inclusive, which satisfy $x^3\equiv 1$, mod $d$. For example, $d=20$ implies $x\equiv 1$, mod 20, is the only solution for $x$ between 1 and $d-1=19$. Adding and subtracting multiples of the modulus $d$ gives other valid solutions as $x\rightarrow...,-59,-39,-19,1,21,41...$. In the case of $d=7$, valid solutions are $x\equiv \{1,2,4\}$, mod 7. Adding and subtracting multiples of $d$ gives other solutions as $x\rightarrow...,-6,-5,-3,1,2,4,8,9,...$.
The strategy is to use PowerModList
to find base solutions for $x$, extend the solutions by adding multiples of modulus $d$, find the corresponding solutions for $y=((1-x^3)/d)^{1/3}$, and test these candidate $y$ for integers not equal to zero.
DiophantineCubic[d_] :=
Block[{a, x},
a = PowerModList[1, 1/3, d];
x = Sort[Flatten[Map[# + a &, d*Range[-5, 5]]]];
Thread[{d,
Select[Transpose[{x, (1 - x^3)^(1/3)/d^(1/3)}] /.(-1)^(1/3)->-1,
IntegerQ[#[[2]]] && #[[2]] != 0 &]}]
]
SetAttributes[DiophantineCubic, Listable]
When a solution for given $d$ exists, it seems to be unique. The Range[-5,5]
statement is a total guess. For negative $x$, is seems -d+PowerModList[1,1/3,d]
is all that is required.
There appear to be 32 values $d$ between 1 and 1000 each having a unique solution. It takes 1.5 s to find these on my machine (less than my average lifetime...).
The values of $d$ are: ${1, 2, 7, 9, 17, 19, 20, 26, 28, 37, 43, 63, 65, 91, 124, 126, 182, \
215, 217, 254, 342, 344, 422, 511, 513, 614, 635, 651, 728, 730, 813, \
999}$.