Let x = gallons of the 25% solution and (5-x) = gallons of the 10% solution.
Then use a weighted average: { 25x + 10(5-x) }/(x + 5 - x) = 17
Doing the algebra, we find
15x = 35 or x = 7/3 gallons of the 25% solution
5-x = 8/3 gallons of the 10% solution