Godtone (talk | contribs)
m →MOSS names i think are pretty: made note about 6L2s being a true exception
Godtone (talk | contribs)
→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[0]!=x[1]:
if type(x)==int:
return len( fact(unfact(x),sg) if type(x)==list else fact(x,sg) )==len(sg)
x = (x, 1) # ensure (x, y) = x/y tuple form if not a monzo
else: # 1/1 is in all subgroups
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()