Explanation:
The number of tickets sold by Dan the first day is x.
Tickets sold on the 2nd day: x+3
on the 3rd day: x+6
on the 4th day: x+9
on the 5th: x+12
Since the total of tickets sold by Dan is 40:
x+(x+3)+(x+6)+(x+9)+(x+12)=40
5x+30=40
5x=10
x=2
number of tickets sold on the third day: 8