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/prime-decomposition/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 / prime-decomposition / oracle.py` 13 lines ยท 444 bytes Raw Blame History 1 # Independent reference for "Prime decomposition" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 def f(n): 4 out, d = [], 2 5 while d * d <= n: 6 while n % d == 0: 7 out.append(d); n //= d 8 d += 1 9 if n > 1: 10 out.append(n) 11 return out 12 for n in [12, 360, 97, 1001, `2147483647`, `600851475143`, 2**64 - 1]: 13 print(f"{n} = " + " x ".join(map(str, f(n))))