how can I only show the integers values of this Table data? Like I don't want to see all the other imaginary values displayed even.
Table[Sqrt[(x + y)], {x, -20, 20}, {y, -20, 20}]
Also: You know how the data is displayed in arrays {{},{},{},...{}} which goes through x=-20 with All of y, then x=-19 with all of y again ...etc....x=20 with all of y. Can the actual x and y elements be displayed also (besides the actual final values)?
Thanks, Steve
Flatten[Table[Block[{t = x + y, s}, If[t >= 0, s = Sqrt[t]; If[IntegerQ[s], {{x, y}, s}, Nothing], Nothing]], {x, -20, 20}, {y, -20, 20}], 1]
do what you want? $\endgroup$ – J. M.'s ennui♦ Jan 25 '20 at 23:03sol = SortBy[{x, y, s} /. Solve[s == Sqrt[(x + y)] && -20 <= x <= 20 && -20 <= y <= 20, {x, y, s}, Integers], Last]
$\endgroup$ – Bob Hanlon Jan 26 '20 at 0:29