For reference, I know Landover are a parody, I'm not for one second suggesting the sun is that close and, while this isn't homework (Im in my 30s) it is close enough to possibly count. My science just isn't up to seeing whats wrong with it (you know - its hard being a social sciences graduate on this forum )
Here is the proof:
To start off with, the sun is hot enough to glow yellow, so we can use Wein's Displacement Law to determine the temperature.
Wein's Displacement Law:
Peak Wavelength in meters = displacement constant / temperature in Kelvin
Yellow light has a wavelength between 570nm and 580nm, so we'll solve for 575nm. Since we are working with nanometers rather than meters, we'll simplify the math by multiplying the displacement constant by 10^9.
575 = 2897768.5/T
575 * T = 2897768.5
T = 2897768.5/575
T = 5039.6° K (8611.6° F)
So the sun is about 5039.6° Kelvin.
Now, the average temperature of the earth is 59° F, or about 288° K. The mean temperature gradient of the troposphere is 6° K/km, so let's solve for the distance.
d = (5039.6 - 288)/6
d = 791.9 km (491.1 miles)