Shawn collected 40 plain pebbles. He painted 9 pebbles red and 13 pebbles blue. He then divided the remaining pebbles equally into 3 groups, and painted them purple, yellow, and green. What is the difference between the number of blue and yellow pebbles?
After painting the red and blue pebbles, Shawn had a remainder of 40 - 9 - 13 = 
<gadget id="calculator">40-9-13</gadget>
<output>18</output>
18 pebbles.
He painted 18/3 = 
<gadget id="calculator">18/3</gadget>
<output>6</output>
6 pebbles yellow.
The difference between the number of blue and yellow pebbles is 13 - 6 = 
<gadget id="calculator">13-6</gadget>
<output>7</output>
7.

<result>7</result>