This problem is many years old and will never be addressed. Likely the course will be put on a sunset path and get replaced with something else, or at least that has been the pattern over the years. From this side it’s likely nothing or very little is ever responded to with more than lip service. It is what it is. People are protecting their jobs and the boss pays the bills. There is never any money to go back over old course material and staff turnover is high so there is likely nobody around who had a hand in course creation, hence the sunset on old courses.
The real truth is that if the learners knew anything about prime numbers and prime factorization this would never be an issue. Sadly most learners don’t know these concepts and are expecting a CC course to magically turn them into geeks and gurus and math nerds. Ain’t gonna happen.
from math import sqrt
def is_prime(n):
if n < 2: return False
for x in range(2, int(sqrt(n)) + 1):
if n % x == 0: return False
return True
Now consider we have a list of prime numbers less than or equal to the square root of n. We no longer need the range at all. We could just use that list.
from math import sqrt
def is_prime(n):
if n < 2: return False
for x in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47][:int(sqrt(n)) + 1]:
if n % x == 0: return False
return True
That is enough tests to find all the primes less than 2500
So you see this course is not really messed up as much as many learners don’t understand Maths. They end up here in the forums, tin cup in hand and any answer we give them that works is enough to get them through the day.