1 | initial version |
This is a bit ill-defined - the infinitely many such primes? But here is something you can probably modify.
sage: N = 123
sage: prod(1/p for p in set(primes(N)).difference(set(N.prime_factors())))
1/256992314149736648684107368223932215392477130