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/pascals-triangle/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 / pascals-triangle / oracle.py` 10 lines ยท 596 bytes Raw Blame History 1 # Independent reference for "Pascal's triangle" (Python 3, standard library only). 2 # expected.txt is this program's stdout; omc never produced it. 3 # Cross-check, WolframLanguageEvaluator: Table[Binomial[n, k], {n, 0, 9}, {k, 0, n}] 4 # -> {{1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1}, {1, 4, 6, 4, 1}, {1, 5, 10, 10, 5, 1}, 5 # {1, 6, 15, 20, 15, 6, 1}, {1, 7, 21, 35, 35, 21, 7, 1}, {1, 8, 28, 56, 70, 56, 28, 8, 1}, 6 # {1, 9, 36, 84, 126, 126, 84, 36, 9, 1}} 7 from math import comb 8 n = 10 9 for r in range(n): 10 print(" " * (2 * (n - r - 1)) + " ".join(str(comb(r, k)) for k in range(r + 1)))