[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tomusatov at gmail.com wrote: > Thank you very much! Do you also know how I might slightly alter to > composite numbers that are one less than twice a composite number? > > 15 would be the first number > Since 8 is composite then > > 2*8=16 > 16 - 1=15 Is composite Like >>> def is_composite(n): ... return not is_prime(n) ... >>> print(list(islice((i for i in count(3, step=2) if is_composite(i) and is_composite((i+1)//2)), 20))) [15, 27, 35, 39, 49, 51, 55, 63, 65, 69, 75, 77, 87, 91, 95, 99, 111, 115, 119, 123] ?

- Prev by Date:
**Program to output a subset of the composite numbers** - Next by Date:
**How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?** - Previous by thread:
**Program to output a subset of the composite numbers** - Next by thread:
**Program to output a subset of the composite numbers** - Index(es):