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/pernicious-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 / pernicious-numbers / oracle.py` 12 lines ยท 553 bytes Raw Blame History 1 # Independent reference for "Pernicious numbers" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 PRIMES = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61} 4 def pern(n): 5 return bin(n).count("1") in PRIMES 6 out, n = [], 0 7 while len(out) < 25: 8 n += 1 9 if pern(n): 10 out.append(n) 11 print("first 25 pernicious numbers: " + " ".join(map(str, out))) 12 print("pernicious numbers from `888888877` to `888888888`: " + " ".join(str(n) for n in range(`888888877`, `888888889`) if pern(n)))