qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())

ans = [0] * (n+1)
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            tmp = i*i + j*j * k*k + i*j + j*k + i*k
            if tmp <= n:
                ans[tmp] += 1

for i in range(1, n+1):
    print(ans[i])


Fixed code:
n = int(input())

ans = [0] * (n+1)
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            tmp = i*i + j*j + k*k + i*j + j*k + i*k
            if tmp <= n:
                ans[tmp] += 1

for i in range(1, n+1):
    print(ans[i])
Buggy code:
n = int(input())
ans = [0 for i in range(n)]


for i in range(100):
  for j in range(100):
    for k in range(100):
      a = (i+1)*(i+1) +(j+1)*(j+1) + (k+1)*(k+1) + (i+1)*(j+1) +(j+1)*(k+1) + (k+1)*(i+1)
      if a < n:
        ans[a]+=1
for i in ans:
  print(i)

Fixed code:
n = int(input())
ans = [0 for i in range(n)]


for i in range(100):
  for j in range(100):
    for k in range(100):
      a = (i+1)*(i+1) +(j+1)*(j+1) + (k+1)*(k+1) + (i+1)*(j+1) +(j+1)*(k+1) + (k+1)*(i+1)
      if a <= n:
        ans[a-1]+=1
for i in ans:
  print(i)
Buggy code:
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n = int(input())
    l = [0]*(n+1)
    for x in range(101):
        for y in range(101):
            for z in range(101):
                temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if temp <= n:
                    l[temp] += 1

    for i in range(1, n+1):
        print(l[i])


if __name__ == '__main__':
    main()


Fixed code:
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n = int(input())
    l = [0]*(n+1)
    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if temp <= n:
                    l[temp] += 1

    for i in range(1, n+1):
        print(l[i])


if __name__ == '__main__':
    main()
Buggy code:
N = int(input())

cnt = [0] * 6 * 10000 + 1

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            cnt[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1

for i in range(1, N + 1):
    print(cnt[i])


Fixed code:
N = int(input())

cnt = [0] * (6 * 10000 + 1)

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            cnt[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1

for i in range(1, N + 1):
    print(cnt[i])
Buggy code:
n = int(input())
ans  = [0 for i in range(10**5)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

for i in ans:
    print(i)

Fixed code:
n = int(input())
ans  = [0 for i in range(10**5)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

for i in range(1,n+1):
    print(ans[i])
Buggy code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def checker():
    ans = [0] * 10000
    for a in range(1, 101):
        for b in range(1, 101):
            for c in range(1, 101):
                n = a * a + b * b + c * c + a * b + b * c + c * a
                if n > 10000:
                    continue
                else:
                    ans[n] += 1
    return ans


def main():
    N = int(input().strip())
    ans = checker()
    for n in range(1, N + 1):
        print(ans[n])
    return


if __name__ == "__main__":
    main()


Fixed code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def checker():
    ans = [0] * 10001
    for a in range(1, 101):
        for b in range(1, 101):
            for c in range(1, 101):
                n = a * a + b * b + c * c + a * b + b * c + c * a
                if n > 10000:
                    continue
                else:
                    ans[n] += 1
    return ans


def main():
    N = int(input().strip())
    ans = checker()
    for n in range(1, N + 1):
        print(ans[n])
    return


if __name__ == "__main__":
    main()
Buggy code:
N = int(input())
list = [0]*1001
for i in range(1,1001):  
    for j in range(1,1001):
        a = i*i + j*j + i*j
        for k in range(1,1001):
            a = i*i + j*j + k*k + i*j +j*k + i*k
            if a <= N:
                list[a] += 1
for i in range(1,N+1):
    print(list[i])

Fixed code:
N = int(input())
list = [0]*(N+1)
for i in range(1,100):  
    for j in range(1,100):
        a = i*i + j*j + i*j
        for k in range(1,100):
            a = i*i + j*j + k*k + i*j +j*k + i*k
            if a <= N:
                list[a] += 1
for i in range(1,N+1):
    print(list[i])
Buggy code:
import math


def pattern(x, y, z):
    if x == y == z:
        return 1
    elif x != y != z:
        return 6
    else:
        return 3


def check(upper_value, ans):
    cnt = 0
    for x in range(1, ans):
        if pow(x, 2) > ans:
            break
        for y in range(x, ans):
            if pow(x+y, 2) > ans:
                continue
            for z in range(y, ans):
                tmp = x*(x+y+z) + y*(y+z) + z*z
                if tmp == ans:
                    cnt += pattern(x, y, z)
                elif tmp > ans:
                    continue
    print(cnt)


N = int(input())
# x^2 + y^2 + z^2 + x*y + y*z + z*x = n

for i in range(N+1):
    #upper_value = int(math.sqrt(i))
    check(0, i)


Fixed code:
import math


def pattern(x, y, z):
    if x == y == z:
        return 1
    elif x != y and y != z and x != z:
        return 6
    else:
        return 3


def check(ans):
    cnt = 0
    upper = int(math.sqrt(ans))
    for x in range(1, upper):
        if pow(x, 2) > ans:
            break
        for y in range(x, upper):
            if pow(x+y, 2) > ans:
                break
            for z in range(y, upper):
                tmp = x*(x+y+z) + y*(y+z) + z*z
                # tmp = pow(x+y+z, 2) - x*(y+z) - y*z
                if tmp == ans:
                    cnt += pattern(x, y, z)
                    if x == y and y == z and z == x:
                        print(cnt)
                        return
                elif tmp > ans:
                    break
    print(cnt)


N = int(input())
# x^2 + y^2 + z^2 + x*y + y*z + z*x = n

for i in range(1, N+1):
    # upper_value = int(math.sqrt(i))
    check(i)
Buggy code:
n=int(input())
ans=[0]*n
x=1
y=1
z=1
c=0
for i in range(1,n+1):
	if 6*i*i>n:
		d=i
		break;
print(d)

for i in range(1,n+1):
	if 1+2*i*i+i+i+i*i>n:
		e=i
		break;
print(e)

for i in range(d):
	x=i+1
	y=x
	z=x
	for j in range(i,e):
		y=j+1
		z=y
		for k in range(j,n):
			z=k+1
			print(x,y,z)
			b=x*x+y*y+z*z+x*y+y*z+z*x
			if b>n:
				c=1
				break;
			if x!=y and y!=z and z!=x:
				ans[b-1]+=6
			elif (x==y and x!=z) or (y==z and x!=y):
				ans[b-1]+=3
			elif x==y and y==z:
				ans[b-1]+=1
		#if c==1:
			#break;
	#if c==1:
		#break;


for i in range(n):
	print(ans[i])

Fixed code:
n=int(input())
ans=[0]*n
x=1
y=1
z=1
c=0
for i in range(1,n+1):
	if 6*i*i>n:
		d=i
		break;
#print(d)

for i in range(1,n+1):
	if 1+2*i*i+i+i+i*i>n:
		e=i
		break;
#print(e)

for i in range(d):
	x=i+1
	y=x
	z=x
	for j in range(i,e):
		y=j+1
		z=y
		for k in range(j,n):
			z=k+1
			#print(x,y,z)
			b=x*x+y*y+z*z+x*y+y*z+z*x
			if b>n:
				c=1
				break;
			if x!=y and y!=z and z!=x:
				ans[b-1]+=6
			elif (x==y and x!=z) or (y==z and x!=y):
				ans[b-1]+=3
			elif x==y and y==z:
				ans[b-1]+=1
		#if c==1:
			#break;
	#if c==1:
		#break;


for i in range(n):
	print(ans[i])
Buggy code:
import math
n = int(input())
# ans = [0 for _ in range(n)]
ans = [0] * n

for x in range(1, int(math.sqrt(n+1))):
    x2 = x*x
    for y in range(1, int(math.sqrt(n+1))):
        y2 = y*y
        xy = x * y
        tmp = x2 + y2 + xy
        if tmp >= n:
            break
        for z in range(1, int(math.sqrt(n+1))):
            tmp2 = tmp + z*z + y*z + z*x
            if tmp2 > n:
                break
            try:
                ans[tmp2 - 1] += 1
                print(x, y, z)
            except:
                pass
for i in range(n):
    print(ans[i])


Fixed code:
import math
n = int(input())
# ans = [0 for _ in range(n)]
ans = [0] * n

for x in range(1, int(math.sqrt(n+1))):
    x2 = x*x
    for y in range(1, int(math.sqrt(n+1))):
        y2 = y*y
        xy = x * y
        tmp = x2 + y2 + xy
        if tmp >= n:
            break
        for z in range(1, int(math.sqrt(n+1))):
            tmp2 = tmp + z*z + y*z + z*x
            if tmp2 > n:
                break
            try:
                ans[tmp2 - 1] += 1
                # print(x, y, z)
            except:
                pass
for i in range(n):
    print(ans[i])
Buggy code:
N = int(input())

def calc(n):
    ans = [0 for i in range(n+1)]
    for x in range(1,n+1):
        a = x**2
        if a>=n:
            break
        for y in range(1,1+n):
            b = y**2
            if b>=n:
                break
            for z in range(1,1+n):
                c = z**2
                if c>=n:
                    break
                f = a+b+c+x*y+y*z+z*x
                if f>n:
                    break
                ans[f]+=1
    return ans

res = calc(N)
for i in range(N):
    print(res[i])

Fixed code:
N = int(input())

def calc(n):
    ans = [0 for i in range(n+1)]
    for x in range(1,n+1):
        a = x**2
        if a>=n:
            break
        for y in range(1,1+n):
            b = y**2
            if b>=n:
                break
            for z in range(1,1+n):
                c = z**2
                if c>=n:
                    break
                f = a+b+c+x*y+y*z+z*x
                if f>n:
                    break
                ans[f]+=1
    return ans

res = calc(N)
for i in range(N):
    print(res[i+1])
Buggy code:
n = int(input())
ans = [0] * 10010

def get_ans(n):
  cnt = 0
  for x in range(1, 101):
    for y in range(1, 101):
      for z in range(1, 101):
        k = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if(k <= 10000):
          ans[k] += 1        
  return ans

ans = get_ans(n)
for i in range(n+1):
  print(ans[i])

Fixed code:
n = int(input())
ans = [0] * 10010

def get_ans(n):
  cnt = 0
  for x in range(1, 101):
    for y in range(1, 101):
      for z in range(1, 101):
        k = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if(k <= 10000):
          ans[k] += 1        
  return ans

ans = get_ans(n)
for i in range(1, n+1):
  print(ans[i])
Buggy code:
ans = [0 for i in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i**2 + j**2 + k**2 + i*j + j*k + i*k
      if v < 10050:
        ans[v] +1
       
n = int(input())
for i in range(n):
  print(ans[i+1])




Fixed code:
ans = [0 for i in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i**2 + j**2 + k**2 + i*j + j*k + i*k
      if v < 10050:
        ans[v]+=1
       
n = int(input())
for i in range(n):
  print(ans[i+1])
Buggy code:
NN=int(input())
A=[0]*N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      if x**2+y**2+z**2+x*y+y*z+z*x<=N:
        A[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
for i in range(N):
  print(A[i])

Fixed code:
N=int(input())
A=[0]*N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      if x**2+y**2+z**2+x*y+y*z+z*x<=N:
        A[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
for i in range(N):
  print(A[i])
Buggy code:
n = int(input())
xyz = [[[0 for i in range(101)] for j in range(101)] for k in range(101)]
ans = [0 for i in range(n+1)]

def gen_n(x, y, z):
    return x*2 + y*2 + z*2 + x*y + y*z + z*x
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            num = gen_n(i, j, k)
            if n >= num:
                ans[num] += 1
for i in range(1, n+1):
    print(ans[i])


Fixed code:
n = int(input())
xyz = [[[0 for i in range(101)] for j in range(101)] for k in range(101)]
ans = [0 for i in range(n+1)]

def gen_n(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            num = gen_n(i, j, k)
            if n >= num:
                ans[num] += 1
for i in range(1, n+1):
    print(ans[i])
Buggy code:
n=int(input())
l=[0]*(10**4+1)
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            t=x*x+y*y+z*z+x*y+y*z+z*x
            if t<=10**4:
                if (x!=y) and y!=z:
                    l[t]+=6
                elif x==y and y==z:
                    l[t]+=1
                else:
                    l[t]+=3
for i in range(1,n):
    print(l[i])

Fixed code:
n=int(input())
l=[0]*(10**4+1)
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            t=x*x+y*y+z*z+x*y+y*z+z*x
            if t<=10**4:
                if (x!=y) and y!=z:
                    l[t]+=6
                elif x==y and y==z:
                    l[t]+=1
                else:
                    l[t]+=3
for i in range(1,n+1):
    print(l[i])
Buggy code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i * i + j * j + k * k + i * j + j * k + k * j
      if v < 10050:
        ans[v] += 1

for i in range(n):
  print(ans[i + 1])


Fixed code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i * i + j * j + k * k + i * j + j * k + k * i
      if v < 10050:
        ans[v] += 1

for i in range(n):
  print(ans[i + 1])
Buggy code:
from collections import defaultdict

n = int(input())

d = defaultdict(int)

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            num = i**2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            d[num] += 1

for i in range(n+1):
    print(d[i])


Fixed code:
from collections import defaultdict

n = int(input())

d = defaultdict(int)

for i in range(1, 120):
    for j in range(1, 120):
        for k in range(1, 120):
            num = i**2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            d[num] += 1

for i in range(1,n+1):
    print(d[i])
Buggy code:
N=int(input())
sum=[0]*N
for x in range(1,N):
    for y in range(1,N):
        for z in range(1,N):
            a=x*x+y*y+z*z+x*y+y*z+x*z
            if a<=N:
                sum[a-1]=sum[a-1]+1

for i in range(N):
    print(sum[i-1])

Fixed code:
N=int(input())
sum=[0]*N
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a=x*x+y*y+z*z+x*y+y*z+x*z
            if a<=N:
                sum[a-1]=sum[a-1]+1

for i in sum:
    print(i)
Buggy code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v > N:
        continue
      ans[v] += 1

for i in range(N):
  print(ans[i])

Fixed code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v > N:
        continue
      ans[v - 1] += 1

for i in range(N):
  print(ans[i])
Buggy code:
n=int(input())
 
ans=[0]*(n+1)
 
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            f= x**2 + y**2 + z**2 + x*y + y*z + z*x
            if f==n:
                ans[f]+=1
 
for i in range(1,n+1):
    print(ans[i])

Fixed code:
n=int(input())

ans=[0]*(n+1)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            f= x**2 + y**2 + z**2 + x*y + y*z + z*x
            if f<=n:
                ans[f]+=1

for i in range(1,n+1):
    print(ans[i])
Buggy code:
    n=int(input())
    f=[0]*10005
    for x in range(1,101):
      for j in range(1,101):
        for z in range(1,101):
          c=x**2+j**2+z**2+x*j+j*z+z*x
          if c<=n:
            f[c]+=1
    for i in range(1,n+1):
      print(f[i])

Fixed code:
n=int(input())
f = [0]*10005

for x in range(1,101):
	for y in range(1,101):
		for z in range(1,101):
			c = x**2+y**2+z**2+x*y+y*z+z*x
			if c<=n: f[c]+=1
for i in range(1,n+1):
	print(f[i])
Buggy code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    ans = [0] * (6 * 10**4 + 10)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                ans[x**2 + y**2 + z**2 + x * y + y * z + x * z] += 1

    for i in range(N):
        print(ans[i])


if __name__ == "__main__":
    main()


Fixed code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    ans = [0] * (6 * 10**4 + 10)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                ans[x**2 + y**2 + z**2 + x * y + y * z + x * z - 1] += 1

    for i in range(N):
        print(ans[i])


if __name__ == "__main__":
    main()
Buggy code:
n = int(input())
ans = [0] * n
loop = int((n/6) ** 1.5) + 1

def f(i, j, k):
    return i ** 2 + j ** 2 + k ** 2 + i*j + j*k + k*i

for i in range(1, loop+1):
    for j in range(1, loop+1):
        for k in range(1, loop+1):
            res = int(f(i, j, k))
            if res <= n:
                ans[res] += 1

for a in ans:
    print(a)

Fixed code:
n = int(input())
ans = [0] * (n + 1)
loop = int(n ** .5) + 1

def f(i, j, k):
    return i ** 2 + j ** 2 + k ** 2 + i*j + j*k + k*i

for i in range(1, loop+1):
    for j in range(1, loop+1):
        for k in range(1, loop+1):
            res = int(f(i, j, k))
            if res <= n:
                ans[res] += 1

for a in ans[1:]:
    print(a)
Buggy code:
N = int(input())
A = [0] * 10000
for x in range(1, int(pow(N, 0.5))):
    for y in range(1, int(pow(N, 0.5))):
        for z in range(1, int(pow(N, 0.5))):
            value = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if value > 10000:
                break
            A[value] += 1
for a in A[:N]:
    print(a)

Fixed code:
N = int(input())
A = [0] * 10001
for x in range(1, int(pow(N, 0.5))):
    for y in range(1, int(pow(N, 0.5))):
        for z in range(1, int(pow(N, 0.5))):
            value = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if value > 10000:
                break
            A[value] += 1
for a in A[1:N+1]:
    print(a)
Buggy code:
n=int(input())
a=[0 for i in range(100001)]
for i in range(1,41):
    a[6*(i**2)]+=1
for i in range(1,99):
    for j in range(1,i):
        if 3*(i**2)+j**2+2*i*j<=10000:
            a[3*(i**2)+j**2+2*i*j]+=3
        if 3*(j**2)+i**2+2*i*j <=10000:
            a[3*(j**2)+i**2+2*i*j]+=3
for i in range(1,100):
    for j in range(1,i):
        if i**2+j**2+i*j+i+j>9999:
            break
        for k in range(1,j):
            if i**2+j**2+k**2+i*j+i*k+j*k>10000:
                break
            else:
                a[i**2+j**2+k**2+i*j+i*k+j*k]+=6
for i in range(1,n):
    print(a[i])

Fixed code:
n=int(input())
a=[0 for i in range(100001)]
for i in range(1,41):
    a[6*(i**2)]+=1
for i in range(1,99):
    for j in range(1,i):
        if 3*(i**2)+j**2+2*i*j<=10000:
            a[3*(i**2)+j**2+2*i*j]+=3
        if 3*(j**2)+i**2+2*i*j <=10000:
            a[3*(j**2)+i**2+2*i*j]+=3
for i in range(1,100):
    for j in range(1,i):
        if i**2+j**2+i*j+i+j>9999:
            break
        for k in range(1,j):
            if i**2+j**2+k**2+i*j+i*k+j*k>10000:
                break
            else:
                a[i**2+j**2+k**2+i*j+i*k+j*k]+=6
for i in range(1,n+1):
    print(a[i])
Buggy code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            n = x*x+y*y+z*z+x*y+y*z+z*x
                d[n]+=1
for i in range(1,N+1):
    print(d[i])

Fixed code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            n = x*x+y*y+z*z+x*y+y*z+z*x
            d[n]+=1
for i in range(1,N+1):
    print(d[i])
Buggy code:
n = int(input())
for i in range(5):
    print(0)
count = [0] * (10**6)
s = 0

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            s = i * i + j * j + k * k + i * j + j * k + k * i 
            count[s] += 1
for i in range(n):
    print(count[i])


Fixed code:
n = int(input())
count = [0] * (10**6)
s = 0

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            s = i * i + j * j + k * k + i * j + j * k + k * i 
            count[s - 1] += 1
for i in range(n):
    print(count[i])
Buggy code:
import math

n = int(input())
arr = [0] * n

for x in range(1,201):
    for y in range(1,201):
        for z in range(1,201):
            ans = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if ans <= n:
                arr[ans - 1] += 1

for i in range(n):
    print(arr[i])

Fixed code:
import math

n = int(input())
arr = [0] * n

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ans = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if ans <= n:
                arr[ans - 1] += 1

for i in range(n):
    print(arr[i])
Buggy code:
n = int(input())
ans = [0 for _ in range(n+1)]
def calc(n):
    for x in range(1, n+1):
        for y in range(1, n+1):
            for z in range(1, n+1):
                v = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if v < n+1:
                    ans[v] += 1

calc(n)
for i in range(1, n):
    print(ans[i+1])


Fixed code:
n = int(input())
ans = [0 for _ in range(n+1)]
def calc(n):
    for x in range(1, int(n**0.5)+1):
        for y in range(1, int(n**0.5)+1):
            for z in range(1, int(n**0.5)+1):
                v = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if v < n+1:
                    ans[v] += 1

calc(n)
for i in range(n):
    print(ans[i+1])
Buggy code:
n = int(input())
a = [0]*(n+1)
for n in range(1, n+1):
    for i in range(1, 102):
        for j in range(1, 102):
            for k in range(1, 102):
                if n == (i*i + j*j + k*k + i*j + j*k + i*k):
                    a[n]+=1
for x in a[1:]:
    print(x)

Fixed code:
n = int(input())
a = [0]*(n+1)
for i in range(1, 102):
    for j in range(1, 102):
        for k in range(1, 102):
            if (i*i + j*j + k*k + i*j + j*k + i*k) <= n:
                a[i*i + j*j + k*k + i*j + j*k + i*k] +=1
for x in a[1:]:
    print(x)
Buggy code:
def f(N):
    global table
    for x, y, z in combinations_with_replacement(range(1, 100), 3):
        n = x**2+y**2+z**2+x*y+y*z+z*x
        if n>N:
            continue
        if x==y==z:
            table[n] = 1
        elif x==y or y==z or z==x:
            table[n] = 3
        else:
            table[n] = 6
N = int(input())
table = [0 for _ in range(N+1)]
f(N)
for n in range(1, N+1):
    print(table[n])

Fixed code:
from itertools import combinations_with_replacement
def f(N):
    global table
    for x, y, z in combinations_with_replacement(range(1, 100), 3):
        n = x**2+y**2+z**2+x*y+y*z+z*x
        if n>N:
            continue
        if x==y==z:
            table[n] += 1
        elif x==y or y==z or z==x:
            table[n] += 3
        else:
            table[n] += 6
N = int(input())
table = [0 for _ in range(N+1)]
f(N)
for n in range(1, N+1):
    print(table[n])