Distinct Primes Factors¶
The prime omega function $\omega(n)$ counts the number of distinct prime factors of $n$. SageMath provides this function through the PARI/GP interface, but we can also just look at the length of the output of the built-in factor function.
See problem 3 for information on implementing a factorization function.
In [1]:
from itertools import count
def omega(n):
return len(factor(n))
for n in count(1):
if all(omega(n+k) == 4 for k in (0,1,2,3)):
break
n
Out[1]:
134043
Relevant sequences¶
- Number of distinct prime factors: A001221
Copyright (C) 2025 filifa¶
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license and the BSD Zero Clause license.