How can there be concentration and pressure terms simultaneously in the Nernst equation?
This topic often causes confusion.

The most correct form of the Nernst equation uses thermodynamic activity of the substances:

$$E = E^{\circ} - \frac{RT}{zF} \ln\frac{a_\mathrm{red}}{a_\mathrm{ox}}$$

For diluted solutions, we can replace the activity of a substance with its concentration in the solution. But how do we express the activity of a gas?

This is basically the question of how to formulate the equilibrium constant of the redox reaction. There are actually multiple solutions to this. The problem is that all of them are correct.

Solution 1: Express activity of the gas as a function of partial pressure.
\begin{align}
pV &amp;= nRT \\
\Rightarrow p &amp;= \frac{n}{V}RT = cRT\\
a(\mathrm{gas}) &amp;\approx c(\mathrm{gas}) = \frac{p(\mathrm{gas})}{RT}
\end{align}

Solution 2: Just use the partial pressure itself:
$$a(\mathrm{gas}) = p(\mathrm{gas})$$

Solution 3: Use the partial pressure divided by a reference pressure:
$$a(\mathrm{gas}) = \frac{p(\mathrm{gas})}{p(\mathrm{reference})}$$