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/attractive-numbers/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 / attractive-numbers / oracle.py` 14 lines ยท 532 bytes Raw Blame History 1 # Independent reference for "Attractive numbers" (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 att = [n for n in range(1, 121) if omega(n) in (2, 3, 5, 7)] 12 print("attractive numbers up to 120 (the count of prime factors, with multiplicity, is prime):") 13 for i in range(0, len(att), 20): 14 print("".join(f"{n:4d}" for n in att[i:i + 20]))