Assumption: Louis has to spend exactly 46 cents.
1. Since he has only 46 cents to spend, he can not bring trail mix
2. 10x + 8y + 4z = 46
dividing both sides by 2
5x + 4y + 2z = 23
Since RHS is odd, and LHS should also be odd (4y+2z would always be even => 5x should be odd)
therefore x can only be odd => x:1,3
CASE 1: x=1
5*1 + 4y + 2z = 23
4y + 2z = 23-5 = 18
simplifying both sides
2y + z = 9
z can take only odd values so z: (1,3,5,7,9) => 4 possible ways
CASE 2: x=3
10*3 + 4y + 2z = 46
simplifying boh sides
2y + z = 8
y can take any value from 0 to 4 => 5 possible ways
Total no. of ways = 4+5 = 9