The answer is YES. See diagram:
The key here is that you can write down the expressions for the angles $a_2, a_3, a_4$ in terms of the angles of the prism $\alpha, \beta, \gamma$ and the first angle $a_1$. Now $\alpha + \beta + \gamma = 180$ and you know you must have total internal reflection with the first three angles, but not with $a_4$.
$$a_2 = \gamma - a_1\\
a_3 = \beta - a_2\\
a_4 = \alpha - a_3$$
So expressing $a_4$ in terms of $a_1$ we get
$$\begin{align}\\
a_4 &= \alpha - (beta - (\gamma - a_1))\\
&= \alpha - \beta + \gamma - a_1\\
&= \alpha + \beta + \gamma - (a_1 + 2\beta)\\
&= 180 - (a_1 + 2\beta)\end{align}$$
Playing around a bit with these equations, I find that the optimal solution is obtained with
$$\alpha = 36\\
\beta = 72\\
\gamma = 72\\
a_1 = 36$$
In this case, you have $a_2 = 36, a_3 = 36, a_4 = 0$. In other words, as long as you can get total internal reflection with an angle of incidence of 36 degrees, you can do it - and as a bonus, you go "straight in" and come "straight out" - see below (approximately accurate):
This requires a refractive index just greater than 1.7 ($1/\sin(36)$ - definitely possible.
If you are willing to have the exit direction ($a_4$) be something other than zero, then you can improve on the above solution (make it possible with lower refractive index).
The main thing I don't understand is how the wavelength is effecting
whether or not the light exits the prism.
Wavelength comes into play because the index of refraction of a material is not a fixed constant. It depends on the wavelength. That's why a prism of glass breaks white light into a rainbow of colors. The different wavelengths of light that make up what we see as 'white light' are "bent" (or "refracted") by different amounts by the glass prism because the index of refraction of the glass is not a constant n but rather a wavelength dependent n(λ).
I believe that the index of refraction of most glasses in the visible wavelength region tends to increase with wavelength (or is it the other way around? I'll leave that to you to look up). So if you find the key wavelength which is at the borderline between allowing light to either (1) exit the prism or (2) "reflect perpendicular to the x axis", then it follows that wavelengths shorter and longer than this key wavelength will behave as (1) and (2), respectively; or as (2) and (1), respectively.
Best Answer
If the angle of the ray to each of the two surfaces of the prism is the same, it follows from symmetry that you should be able to flip the scenario left-right about an axis that bisects the angle connecting the surfaces, and have the same exact picture.
But this implies that the ray inside the prism must be perpendicular to that axis, which would put it horizontal to the base of the prism if, and only if, it is isosceles.
You are right, if you want to claim that the ray is parallel to a surface it is not interacting with, then you need to specify the relationship of that surface to the other surfaces..