Last active
June 24, 2020 03:52
-
-
Save jack980517/e903cddfb9e0c6c59c82bcab2d009f28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python2 | |
#n=denominator | |
#b=base | |
#pfn=prime_factors_of(n) | |
#pfb=prime_factors_of(b) | |
pfn=[2,5,2,5,3,5] | |
pfb=[2,5] | |
pure_recurring=False | |
recurring=False | |
if not set(pfn)&set(pfb): | |
pure_recurring=True | |
recurring=True | |
if not pure_recurring: | |
for i in pfn: | |
if i not in pfb: | |
recurring=True | |
break | |
length_of_not_recurring_part=0 | |
if recurring and not pure_recurring: | |
length_of_not_recurring_part=max([pfn.count(_) for _ in set(pfb)]) | |
print recurring,pure_recurring,length_of_not_recurring_part |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment