Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-rosetta/blob/main/tasks/almost-prime/oracle.py # omega-rosetta aien-dev/omega-rosetta Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-rosetta / tasks / almost-prime / oracle.py` 17 lines ยท 470 bytes Raw Blame History 1 # Independent reference for "Almost prime" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 def omega(n): 4 k, p = 0, 2 5 while n > 1: 6 while n % p == 0: 7 n //= p 8 k += 1 9 p += 1 10 return k 11 for k in range(1, 6): 12 out, n = [], 1 13 while len(out) < 10: 14 n += 1 15 if omega(n) == k: 16 out.append(n) 17 print(f"k = {k}:" + "".join(f" {v}" for v in out))