Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
632 B
1
Indexable
Never
def NWD(a, b):
    while a != b:
        if a > b:
            a = a - b
        else:
            b = b - a

    return a

def trzy():
    max_ciag = 1
    ciag = 2
    start = 1
    for i in range(498):
        nwd = NWD(liczby_int[start], liczby_int[start + 1])
        while True:
            if NWD(nwd,liczby_int[i + ciag]) > 1:
                nwd = NWD(nwd,liczby_int[i + ciag])
                ciag += 1
                if ciag > max_ciag:
                    max_ciag=ciag
            else:
                ciag = 2
                start = i
                break
    print(max_ciag + 1)

trzy()