Mox baked some mango, apple and peach tarts. There were 12 more mango tarts than peach forts and 20 more apple tarts than mango forts. He sold 3/8 of the apple tarts and 1/2 of the mango tarts. He had 145 tarts left. How many tarts did he sell altogether?

Let's start by using variables to represent the number of tarts.

Let M = number of mango tarts
Let A = number of apple tarts
Let P = number of peach tarts

From the problem, we know:

M = P + 12 (12 more mango tarts than peach tarts)
A = M + 20 (20 more apple tarts than mango tarts)

We also know that he sold 3/8 of the apple tarts and 1/2 of the mango tarts, so:

Number of apple tarts sold = 3/8A
Number of mango tarts sold = 1/2M

Finally, we know that he had 145 tarts left, so:

M + A + P = 145

Now we can use substitution to solve for the variables.

Substituting M = P + 12 and A = M + 20 into M + A + P = 145:

(P + 12) + (P + 12 + 20) + P = 145

Simplifying:

3P + 44 = 145

3P = 101

P = 33.67

Since we can't have a fraction of a tart, let's round up to 34 peach tarts.

Using M = P + 12:

M = 46

Using A = M + 20:

A = 66

Now we can calculate the number of tarts sold:

Number of apple tarts sold = 3/8A = 3/8(66) = 24.75

Number of mango tarts sold = 1/2M = 1/2(46) = 23

Again, we can't have a fraction of a tart, so let's round up to 25 mango tarts sold.

Altogether, he sold:

24 apple tarts + 25 mango tarts = 49 tarts.

Let's break down the information given step by step:

Step 1: Let's assume the number of peach tarts as x.

Step 2: Since there were 12 more mango tarts than peach tarts, the number of mango tarts would be (x + 12).

Step 3: Similarly, since there were 20 more apple tarts than mango tarts, the number of apple tarts would be (x + 12 + 20) = (x + 32).

Step 4: The fraction of apple tarts sold is 3/8, so the number of apple tarts sold would be (3/8) * (x + 32) = (3x + 96)/8.

Step 5: The fraction of mango tarts sold is 1/2, so the number of mango tarts sold would be (1/2) * (x + 12) = (x + 12)/2.

Step 6: The total number of tarts sold would be the sum of apple tarts sold and mango tarts sold: (3x + 96)/8 + (x + 12)/2.

Step 7: The total number of tarts remaining after selling is 145, so we can set up the equation: (3x + 96)/8 + (x + 12)/2 = 145.

Step 8: Let's solve the equation to find the value of x.

Multiply both sides of the equation by 8 to simplify it: (3x + 96) + 4(x + 12) = 1160.

Simplify the equation: 3x + 96 + 4x + 48 = 1160.

Combine like terms: 7x + 144 = 1160.

Subtract 144 from both sides of the equation: 7x = 1016.

Divide both sides of the equation by 7: x = 145.14.

Since the number of tarts must be a whole number, we can round down x to the nearest whole number, which gives us x = 145.

Step 9: Now that we've found the value of x, we can substitute it back into the equation in Step 6 to find the total number of tarts sold.

Total number of tarts sold = (3x + 96)/8 + (x + 12)/2 = (3*145 + 96)/8 + (145 + 12)/2 = 441/8 + 157/2 = 55.125 + 78.5 = 133.625.

Rounding down the total number of tarts sold to the nearest whole number, we get 133 sold tarts.

Therefore, Mox sold a total of 133 tarts altogether.