It is impossible for fac to be non-prime and divide lst the way this algorithm is designed. Even though 4 may be a factor of lst, by the time fac = 4 is the case, lst will already have had all the 2s divided out of it, so lst wont be divisible by 4. The algorithm will short-circuit and iterate on fac.
It is impossible for
fac
to be non-prime and dividelst
the way this algorithm is designed. Even though 4 may be a factor oflst
, by the timefac = 4
is the case,lst
will already have had all the 2s divided out of it, so lst wont be divisible by 4. The algorithm will short-circuit and iterate onfac
.