Let O be the center of the earth. Triangle OAS is a right-angle triangle since SA is tangent to the earth, which we consider to be a perfect sphere.
We thus have OS2 = OA2 + AS2
but OA = 40,000,000/(2pi) meters
and OS = OA + 125.7 = OA + 40pi/OS2 ~= OA*OA + 2 OA = 40pi
AS = sqrt(OS2 - OA2) ~= sqrt(2*40pi.40,000,000/2pi) = 40,000 m The horizon is therefore approximately 40 km from the top of the lighthouse.