So, if Dylan has x dollars and he bought 3 tickets with them, the tickets were priced at k dollars per ticket. If he bought 5 tickets with the x dollars and saved 12 total dollars, it would be the same as buying the tickets with x-12 dollars, so we have:

So, with this we have:

If we're looking for a number that satisfies these constraints, we can work with modular arithmetic. We have:

So, we can use the chinese remainder theorem here. So, we clearly have x=3k, which means:

So, since we have x=3k, we also have x=3(5j+4)=15j+12.
So, clearly j=0 won't work so we should have j=1. That means our money per ticket for the five tickets is:

And our money per three tickets is:

This is easily verifiable. Three tickets needs 27 dollars and 5 tickets needs 15 dollars, which is 12 less than 27 dollars. So we have our money per three dollar ticket at 6 more than money per five dollar.