???? = dict()
???? = [2, 3]
?????? = 0
def getPrime(????: int) -> str:
global ????, ????, ??????
assert isinstance(????, int)
assert ???? > 1
def ????(_???????: list, _????: int):
_??????? = math.floor(math.sqrt(_????))
for _???? in _???????:
if _???? % _???? == 0:
return False # ????
elif _???? > _???????:
return True # ???
def ?????():
_????? = ????[-1]+2
while not ????(????, _?????):
_????? += 2
????.append(_?????)
return
def ????(?????: int) -> None: # **???**??????
global ??????
???????? = math.floor(math.sqrt(?????)) # ??????????
???? = ????[??????] # ?????
print(f'{?????}????')
print(f'?????{????}')
if ????? == 1: # ??????????????
print(f'????????????{????}')
return
# (*)
if ????? == ????: # ??????????????????
print(f'{?????}?????????????')
if ????? in ????:
????[?????] += 1
else:
????.update({?????: 1})
return
if not ????? % ????:
print(f'?????{????}??{?????}????')
else:
print(f'????????????{?????}???????????')
while ????? % ????: # ???????????????
# ?????????????????
# ???????????????
# ??????????N?????
# ????????????????
# ??????????
# ??????????????
# ????????????????????????
# ??????????????????????N-1?????
# ????????????????
# ??????????????(#)??????
if ???? > ????????: # (#)
print(f'???????????????{?????}????????')
# ?????????????????
# ??????????????????
# ?????????????(*)??
# ?????????????????????????????????????????
# ???????????????????
????.update({?????: 1})
return
else:
# ???????
?????? += 1
if ?????? == len(????):
?????()
???? = ????[??????]
print(f'???????{????}')
????(????) # ?????????????????(*)?????????????
????(?????//????) # ?????????????????????????????????1????????????return???
print(f'{?????}????')
????(????)
res = f'{????}={"*".join([f"{k}^{v}^" for k, v in ????.items()])}'
res = res.replace('*', '\\*').replace('^1^', '')
????.clear()
?????? = 0
return res
print(getPrime(36))