About the stopping condition of loop

why is the stopping condition p^2 less than equal to m?Can’t there be any prime factor after root over of m? m is the no. whose prime factors we are finding.

hello @Senjuti256
pls refer this -> link

they have covered the proof

I have read it but isn’t it possible that there is a prime factor after root n. What to do with it then say for eg 35?

there will be only prime number(if it exist) which can exceed sqrt(n).