mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-25 13:03:44 +03:00
22 lines
465 B
Python
22 lines
465 B
Python
def check_poly(n):
|
|
n = list(map(int, str(n)))
|
|
return all([n[i - 1] % 2 != n[i] % 2 for i in range(1, len(n))])
|
|
|
|
|
|
def dev(n):
|
|
for x in range(n - 1, 1, -1):
|
|
if n % x == 0:
|
|
return x % 7 == 0
|
|
return False
|
|
|
|
|
|
def get_dev(n):
|
|
for x in range(n - 1, 1, -1):
|
|
if n % x == 0:
|
|
return x
|
|
|
|
|
|
for i in range(1_000_000_000, 10_000_000_000):
|
|
if check_poly(i) and dev(i):
|
|
print(i, get_dev(i))
|