1. **State the problem:** Anna Lee has 3 bags of sweets with quantities 145, 206, and 167.
2. **Find the total number of sweets:**
$$145 + 206 + 167 = 518$$
3. **She repackaged all sweets into equal heaps of 3 and 4 sweets each.**
4. **Let $x$ be the number of heaps of 3 sweets, and $y$ be the number of heaps of 4 sweets.**
5. **The total sweets equation is:**
$$3x + 4y = 518$$
6. **The total number of heaps is:**
$$x + y = n$$
7. **From the problem, the total number of heaps is:**
$$n = \frac{518}{3 + 4} = \frac{518}{7} = 74$$
8. **So,**
$$x + y = 74$$
9. **Solve the system:**
From $x + y = 74$, we get
$$y = 74 - x$$
Substitute into the sweets equation:
$$3x + 4(74 - x) = 518$$
$$3x + 296 - 4x = 518$$
$$-x + 296 = 518$$
$$-x = 518 - 296$$
$$-x = 222$$
$$x = -222$$
10. **Since $x$ cannot be negative, check the problem statement again.**
The problem states heaps of 3 and 4 sweets, and total heaps are 74. The equation $x 3 + x 4 = 518$ is ambiguous; it likely means $3x + 4y = 518$ with $x + y = 74$.
Rearranging:
$$3x + 4(74 - x) = 518$$
$$3x + 296 - 4x = 518$$
$$-x = 518 - 296$$
$$-x = 222$$
$$x = -222$$
This is impossible, so the problem likely means the heaps are formed separately, not combined.
11. **If sweets are repackaged in heaps of 3 and separately in heaps of 4, then:**
- Number of heaps of 3 sweets:
$$\frac{518}{3} = 172.666...$$ (not an integer)
- Number of heaps of 4 sweets:
$$\frac{518}{4} = 129.5$$ (not an integer)
12. **Alternatively, if the total sweets are divided into heaps of size 7 (3+4), then:**
$$\frac{518}{7} = 74$$ heaps total.
13. **The number of sweets used to form heaps of 3 is:**
$$74 \times 3 = 222$$
**Final answer:**
$$\boxed{222}$$ sweets were used to form heaps of 3.
Sweets Heaps
Step-by-step solutions with LaTeX - clean, fast, and student-friendly.