Godtone
Joined 17 December 2020
→My Python 3 code: important correction for getting subgroups to work correctly |
m →My Python 3 code: added a note about the usage of harmonic subgroups |
||
| Line 391: | Line 391: | ||
# EG: `prod([3,2,4])` evaluates to (3*2)*4 = 24. | # EG: `prod([3,2,4])` evaluates to (3*2)*4 = 24. | ||
prod = functools.partial(functools.reduce, lambda x,y: x*y) | prod = functools.partial(functools.reduce, lambda x,y: x*y) | ||
# IMPORTANT NOTE ABOUT USING SUBGROUPS: | |||
# if you're using a subgroup in the form of a list of integers > 1, | |||
# define it as a short temporary variable and pass it in to every function | |||
# that asks for a subgroup parameter "p"; the "p" in the gen_prime(p) function below | |||
# is sort of an exception because it expects a full-prime-limit primes-only subgroup. | |||
# ALSO note that the only type of subgroup currently supported is, as aforementioned, | |||
# a list of integers > 1, as otherwise factorisation gets complicated. | |||
# p is a complete list of (at least 2) primes up to and including some prime. | # p is a complete list of (at least 2) primes up to and including some prime. | ||