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/count-in-factors/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 / count-in-factors / oracle.py` 14 lines ยท 521 bytes Raw Blame History 1 # Independent reference for "Count in factors" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 def factors(n): 4 out, p = [], 2 5 while p * p <= n: 6 while n % p == 0: 7 out.append(p) 8 n //= p 9 p += 1 if p == 2 else 2 10 if n > 1: 11 out.append(n) 12 return out 13 for n in list(range(1, 26)) + list(range(2144, 2157)) + [`600851475143`, `1000000000000`]: 14 print(f"{n} = " + (" x ".join(map(str, factors(n))) if n > 1 else "1"))