Friedman-Ramanujan functions in random hyperbolic geometry and application to spectral gaps