The Task
Write a program or function that, when passed a numerical input x, prints or returns the primes beneath the square root of x1 that are not factors of x.
Examples
Let f(x) be the function called:
>>> f(4) [] >>> f(5) [2] >>> f(20) [3] >>> f(60) [7] >>> f(100) [3, 7] >>> f(10000) [3, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] Bonus Rules
- You may use any builtins that your language provides.
- Your program must support an
xinput as high as the upper bound defined by your language.
1 Using the square root as only primes below the square root can actually be involved within the factors of x. Without making this restriction, larger numbers would have a lot of excess printed numbers.
x" isn't true: a number can have one prime factor that's larger than its square root. Indeed, your first two examples (5 and 20) have this property, as do all primes, twice all odd primes, .... \$\endgroup\$