I came upon this question in a JEE Advanced mock test online:
The number of photons of wavelength $\lambda$ required to achieve pressure $P$ in an empty cubical box of edge length $l$ is given by $\displaystyle \frac{Np\lambda l^3}{hc}$. Find $N.$
In the solution, they have assume that the photon particles behave liked a ideal gas and used the equation $\displaystyle PV=\frac{NMV_\mathrm{rms}^2}{3}$. After that they substituted $MV_\mathrm{rms}(V_\mathrm{rms})$ with $\displaystyle\frac{hc}{\lambda}$.
I tried my best and couldn't find the exact source of this question, but I did find this about photon gasses from Franz Schwabl. Chapter 4 Statistical Mechanics, Edition 2; Springer-Verlag Berlin Heidelberg; pp 197-199:
The value of the mean collision time (of photons) is approximately $τ ≈ \pu{10^{31} s}$ at room temperature and $τ ≈ \pu{10^{18} s}$ at the temperature of the Sun’s interior $(\pu{107 K}).$ Even at the temperature in the center of the Sun, the interaction of the photons is negligible. Photons do indeed constitute an ideal quantum gas.
The number of photons is not conserved. Photons are emitted and absorbed by the material of the cavity walls. From the quantum-field description of photons it follows that each wavenumber and polarization direction corresponds to a harmonic oscillator.
Now I have many questions regarding photon gasses. How did the solution assume the number of molecules to be constant if photons can be emitted or absorbed by cavity walls? Why did they substitute $MV_\mathrm{rms}$ with $h/\lambda$ when the de Broglie equation $p=h/\lambda$ is only applicable to massive particles? And is the question and/or the solution even correct in the first place?