Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
from itertools import product
 
x = int(input())
 
s = 0
for i in product(range(1, x+1), repeat=3):
  s += reduce(math.gcd, i)
print(s)

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Runtime Error):
from itertools import product

x1 = int(input())
x2 = input()

R_i = [i for i, x in enumerate(x2) if x == "R"]
G_i = [i for i, x in enumerate(x2) if x == "G"]
B_i = {i for i, x in enumerate(x2) if x == "B"}

R = len(R_i)
G = len(G_i)
B = len(B_i)

xs = map(sorted, product(R_i, G_i))

s = 0
for a in xs:
    k = a[1]*2 - a[0]  # 2j-i
    if k in B_i:
        s +=1
    i = a[0]*2 - a[1]  # 2j-k
    if i in B_i:
        s +=1
    j = (a[0] + a[1]) / 2
    if j.is_integer():
        j = int(j)
        if j in B_i:
            s +=1
print(R*G*B - s)

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
from itertools import product
 
x = int(input())
print(sum([reduce(math.gcd, i) for i in product(range(1, x+1), repeat=3)]))

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
from itertools import product

x = int(input())
print(sum([reduce(math.gcd, *i) for i in product(range(1, x+1), repeat=3)]))

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
 
x1 = int(input())
x2 = input()
RGB = {"R", "G", "B"}

peint(sum([1 for i, rgb in zip(combinations(range(x1), 3), combinations(x2, 3)) if set(rgb) == RGB and (i[1] - i[0]) != (i[2] - i[1])]))

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
import itertools


def gcd(*numbers):
    return reduce(math.gcd, numbers)

x = int(input())
_sum = [gcd(*i) for i in itertools.product(range(1, x+1), repeat=3)]
print(sum(_sum))

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
import itertools


def gcd(*numbers):
    return reduce(math.gcd, numbers)


x = input()
_sum = [gcd(*i) for i in itertools.product(range(x), repeat=3)]
print(sum(_sum))

Fixed submission:
import math
from itertools import product
 
x = int(input())

s = 0
for a, b, c in product(range(1, x+1), repeat=3):
  s += math.gcd(math.gcd(a, b), c)
print(s)