interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / ludic-numbers / oracle.py

13 lines · 615 bytes Raw Blame History
1# Independent reference for "Ludic numbers" (Python 3, standard library only).
2# expected.txt is this program's stdout; omc never produced it.
3lst = list(range(2, 22000))
4lud = [1]
5while lst:
6 lud.append(lst[0])
7 del lst[::lst[0]]
8s = set(lud)
9print("first 25 ludic numbers: " + " ".join(map(str, lud[:25])))
10print(f"ludic numbers <= 1000: {sum(1 for x in lud if x <= 1000)}")
11print("2000th to 2005th ludic numbers: " + " ".join(map(str, lud[1999:2005])))
12print("ludic triplets (x, x+2, x+6) below 250: " +
13 " ".join(f"({x}, {x + 2}, {x + 6})" for x in lud if x + 6 < 250 and x + 2 in s and x + 6 in s))