Shortest prime number program

swisscheese jimlewis at miclog.com
Sat Feb 11 11:58:55 EST 2006


> [2]+[x for x in range(1,99) if 2**x%x==2]

42 - brilliant!
41:
[2]+[x for x in range(1,99)if 2**x%x==2]
... although it appears Christoph is right that it's not scalable.




More information about the Python-list mailing list