‘factor’ is not defined, you probably meant ‘divisor’.
Not a syntax error, but the variable name ‘lastprime’ is named wrongly.
As per your request no further explicit help, but write the code with some binary isPrime dummy function, then once you’re sure the logic is correct expand the isPrime with the actual prime check. It helps disconfuddling some of the potential confuddlers.
‘factor’ is not defined, you probably meant ‘divisor’.
Not a syntax error, but the variable name ‘lastprime’ is named wrongly.
As per your request no further explicit help, but write the code with some binary isPrime dummy function, then once you’re sure the logic is correct expand the isPrime with the actual prime check. It helps disconfuddling some of the potential confuddlers.
Think about the logic top down, high level first.