hp
toc

Praiku

2016-11-19, post № 147

art, haiku, mathematics, poetry, programming, Python, #prime

While you have no primes,
While you would like to know them.
If, if you could print…

praiku.py; Python2, 202 bytes, 6 lines
_ = 1; while 1: # you have no primes
    _, __, ___ = _ + 1, 1, 2
    while ___ < _: # you would like to know them
        if _ % ___ == 0: __ = 0
        ___ += 1
    if __: "you could"; print _
Jonathan Frech's blog; built 2024/08/31 22:59:44 CEST