Skip to content

Instantly share code, notes, and snippets.

View kirenotneb's full-sized avatar

Erik Benton kirenotneb

View GitHub Profile
@kirenotneb
kirenotneb / prime-friday.py
Created February 1, 2021 08:00
Prime Friday calculator
from datetime import date, timedelta
# This is a static set of all prime Month and plus Day (2 digits) integers. Since it's static we retain this set
# for all comparisons rather than compute it every time.
def isPrime(candidate):
primeSet = [101,103,107,109,113,127,131,211,223,227,229,307,311,313,317,331,401,409,419,421,
503,509,521,523,601,607,613,617,619,701,709,719,727,733,809,811,821,823,827,829,907,911,919,929,
1009,1013,1019,1021,1031,1103,1109,1117,1123,1129,1201,1213,1217,1223,1229,1231]
return candidate in primeSet