24 Solver

Enter 4 numbers
Mode

The solvers that I'm aware of online either (a) don't group solutions, (b) group them insufficiently, (c) only display a single representative of each idea or (d) don't have an "existence" mode (which I use to check whether a puzzle is solvable without reading the solution). This solver is built to show all solutions while highlighting the distinct ideas. For a more flexible form of this solver, check out the general solver.

How solutions are grouped

Many solutions are trivially equivalent - e.g., 3 + 4 + 8 + 9 is the same idea as 9 + 8 + 3 + 4.

This solver groups solutions at two levels, following the theory at 4nums.com:

So [3,4,8,9] has 144 raw expressions but only 4 distinct ideas: adding all four numbers, (3+9)×8÷4, (9−3)×(8−4), and (3×4−9)×8.

Different subgroups within the same idea differ only in their use of identity elements. For example, 12×12+2−2, 12+12×2/2, and (12+12)×2/2 all belong to different subgroups of the same idea.

References & prior work

The grouping logic is based on the equivalence theory developed by 4nums.com, which also has a complete table of all solvable quadruples. Mark Dominus wrote a series of posts on expression equivalence in the 24 puzzle (1, 2, 3). Shreevatsa has a related writeup on inequivalent expressions.

I've also played online a lot at 4nums.com and used their solver as well as this solver