Godtone
Joined 17 December 2020
m →MOSS names i think are pretty: made note about 6L2s being a true exception |
→My Python 3 code: made in_subgroup more correct and work for more cases (no need for manual conversion anymore!) |
||
| Line 678: | Line 678: | ||
ivs |= set([ iv(i[1]*2,i[0]) for i in ivs ]) | ivs |= set([ iv(i[1]*2,i[0]) for i in ivs ]) | ||
return ivs | return ivs | ||
# if x is a monzo (which is assumed if type(x) not in [int,tuple]), assumed to be full prime limit (or check would be redundant) | |||
def in_subgroup(x, sg): | def in_subgroup(x, sg): | ||
if x | if type(x)==int: | ||
x = (x, 1) # ensure (x, y) = x/y tuple form if not a monzo | |||
if type(x)==tuple and x[0]==x[1]: | |||
return True | return True | ||
return len( fact(x,sg) if type(x)==tuple else fact(unfact(x),sg) )==len(sg) | |||
def powerset(s): | def powerset(s): | ||
pset = set() | pset = set() | ||