This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |