I've the following equation:
b==(-12 +
Sqrt[3] Sqrt[
3 (-4 + r)^2 + 12 a^2 (-2 + r) - 4 a (-5 + r) (-2 + r) +
4 a^3 (-2 + r)^2] + 3 r)/(6 (-2 + r))
And $r$ is a given number and I'll run $a$ from $2$ to a given number n, which are all integers.
How can I write a code that will give me only an output of $b$ when the equation gives an integer back?
For example, when I use $r=4$ and use the following code:
Table[Sqrt[a (1 + a) (1 + 2 a)]/Sqrt[6], {a, 1, 100, 1}]
It will find that $a=24$ gives $b=70$, so I want to see only that solution.
Maybe I can use the If[]
function?