def pf_to_n(L, pf, R):
dim = L.shape[<NUM_LIT:0>]<EOL>n = int(round(pf * np.product(L) / sphere_volume(R, dim)))<EOL>pf_actual = n_to_pf(L, n, R)<EOL>return n, pf_actual<EOL>
Returns the number of non-intersecting spheres required to achieve
    as close to a given packing fraction as possible, along with the actual
    achieved packing fraction. for a number of non-intersecting spheres.

    Parameters
    ----------
    L: float array, shape (d,)
        System lengths.
    pf: float
        Fraction of space to be occupied by the spheres.
    R: float
        Sphere radius.

    Returns
    -------
    n: integer
        Number of spheres required to achieve a packing fraction `pf_actual`
    pf_actual:
        Fraction of space occupied by `n` spheres.
        This is the closest possible fraction achievable to `pf`.