6 donuts. He repacked 6 donuts into each box .
Mr. Terence had 18 boxes containing 36 donuts each, that means:
Total donuts = n° boxes*n° donuts
Total donuts = 18*36 = 648
He had in total 648 donuts.
He sold 162 donuts and repacked the rest into 81 boxes. Then:
Rest donuts = Total donuts - sold donuts
Rest donuts = 648 - 162 = 486
The rest donuts are 486 donuts.
He repacked the rest into 81 boxes, then:
n° donuts (each box) = Rest donuts/n° boxes
n° donuts (each box) = 486/81 = 6
The number of donuts that he put in each box is 6 donuts.