set = {{2, a, 2 + a}, {1, 1, a}} Equal @@ Divide @@ %
Execute the code to generate this equation.
2 == a == (2 + a)/a
However, I need the output in this specific form as follows. How can I adjust the code to achieve it?
2 != a == (2 + a)/a
Most likely there are more elegant versions, but this should work:
#1 @@ #2 & @@@ Transpose[{{Unequal, Equal}, Partition[Divide @@ set, 2, 1]}]
EDIT: Special requirements need special solutions, I guess ...
#1 != #2 == #3 & @@ (Divide @@ set)
Thank you! This approach can resolve this issue.