Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for The Best Number Ever by Pro_Babka
import re
def checkio():
cycle_number = '142857'
counter = 0
for i in cycle_number:
if i in cycle_number * 2: # 142857 * 2 = 285714
counter += 1
for i in cycle_number:
if i in cycle_number * 3: # 142857 * 3 = 428571
counter += 1
for i in cycle_number:
if i in cycle_number * 4: # 142857 * 4 = 571428
counter += 1
for i in cycle_number:
if i in cycle_number * 5: # 142857 * 5 = 714285
counter += 1
for i in cycle_number:
if i in cycle_number * 6: # 142857 * 6 = 857142
counter += 1
if counter == 5 * 6:
if int(cycle_number) * 7 == 999999: # 142857 * 7 = 999999
if len(re.compile(cycle_number).findall(str(float(1/7)))) == 2: # 1/7 = 0.142857142857
return int(cycle_number)
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert isinstance(checkio(), (int, float, complex))
March 2, 2020