Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
266 B
0
Indexable
Never
from itertools import permutations
p = permutations(str(123456789))
a = [int(''.join(x)) for x in p]
for x in a:
    test=[]
    for i in range(1,8):
        y=str(x)
        rest=int(y[0:i])%(i+1)
        test.append(rest)
    
    if sum(test)==0:
        print(x)