You are viewing a single comment's thread. Return to all comments →
#python def countofdigits(n): c=1 res=set() while c<n: c=c*10 while True: rem=c %n c=rem*10 if rem==0: return 0 if rem not in res: res.add(rem) else: break return len(res) m=0 num=0 result=['L', '0', 'V', 'E'] for x in range(3, 10000): c=countofdigits(x) if c>m: m=c num=x result.append(num) t=int(input()) for x in range(t): n=int(input()) print(result[n])
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #26: Reciprocal cycles
You are viewing a single comment's thread. Return to all comments →