The ratio of the number of pencils to the number of pens John bought was 3:2. Each pen cost $9 while each pencil cost 1/3 as much as a pen. He paid a total of $108 for all of them. How much more did John spend on the pens than on the pencils?

To solve this problem, we need to find out the number of pencils and pens John bought, as well as how much he spent on each item.

Let's start by assigning variables:
Let the number of pencils John bought be 3x (since the ratio of pencils to pens is 3:2).
Let the number of pens John bought be 2x.

Now, let's figure out the cost of each item:
Since each pen costs $9, John spent 9 * (2x) = 18x dollars on pens.
Each pencil costs 1/3 the cost of a pen, so each pencil costs (1/3) * $9 = $3.
Therefore, John spent 3 * (3x) = 9x dollars on pencils.

The total amount John spent on all the items is $108, so we can set up an equation:
18x + 9x = 108.

Combining like terms, we get:
27x = 108.

Now, we can solve for x:
x = 108 / 27 = 4.

To find out how much John spent on pens, we can substitute x back into our expression for pens:
18x = 18 * 4 = $72.

To find out how much John spent on pencils, we can substitute x back into our expression for pencils:
9x = 9 * 4 = $36.

Now, to find out how much more John spent on pens than pencils, we subtract the amount spent on pencils from the amount spent on pens:
72 - 36 = $36.

Therefore, John spent $36 more on pens than on pencils.