Formula for nearest prime $p_x$ less than a number $k$

52 Views Asked by At

In my attempts to get around Brocard's problem, I've come up with the following formula for the prime factorization of $k!$: $$\prod_{n=1}^x\left(\prod_{s=1}^{\lfloor\log_{p_n}k\rfloor}\left(p_n^{\lfloor\frac{k}{p_n^s}\rfloor}\right)\right).$$ My problem: $x$ needs to be the greatest value for which $\frac{k}{p_x}$ is greater than or equal to $1$. I'm currently too busy to think about it, so: does anyone know of a formula to find $x$?