In the technical literature, a formula is used for the time being, which, in the case of adiabatic gas flow, puts the pipe parameters in connection with the friction factor, the same as with the Mach numbers at the ends of the pipe. This formula is derived by integrating appropriate differential equations with the approach of a friction factor that represents a function of the Mach number, and also varies through the pipe. Our work does not neglect, and the solution of the corresponding equation for laminar and turbulent flow is given. Because in these two cases the calculated pipe length is significantly different, one cannot assume a constant friction factor.