qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n=int(input())
from math import floor,sqrt
sqset=set()
for i in range(1,200):
  sqset.add(i**2)
print(sqset)
def func(m):
  r=0
  for x in range(1,floor(sqrt(m))+1):
    for y in range(1,floor(sqrt(m))+1):
      a=x+y
      b=x**2+y**2+x*y-m
      d=a**2-4*b
      if d in sqset:
        if (sqrt(d)-a)>0 and (sqrt(d)-a)%2==0:
          r+=1
  return r
for i in range(1,n+1):
  print(func(i))

Fixed code:
n=int(input())
from math import floor,sqrt
sqset=set()
for i in range(1,200):
  sqset.add(i**2)
def func(m):
  r=0
  for x in range(1,floor(sqrt(m))+1):
    for y in range(1,floor(sqrt(m))+1):
      a=x+y
      b=x**2+y**2+x*y-m
      d=a**2-4*b
      if d in sqset:
        if (sqrt(d)-a)>0 and (sqrt(d)-a)%2==0:
          r+=1
  return r
for i in range(1,n+1):
  print(func(i))
Buggy code:
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

n = int(input())
# ans = []
# for u in range(1, n+1):
#     cnt = 0
#     for i in range(1, int(n/(u**2))+2):
#         for j in range(1,int(u/(i**2))+2):
#             for k in range(1,int(u/(j**2))+2):
#                 if i**2+j**2+k**2+i*j+j*k+k*i == u:
#                     if i == j == k:
#                         cnt += 1
#                     elif i != j and j != k and k != j:
#                         cnt += 6
#                     else:
#                         cnt += 3
#
#     ans.append(cnt)
# print(ans)
ans = [0] * (n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            cal = i**2+j**2+k**2+i*j+j*k+k*i
            if cal <= n:
                ans[cal] += 1
print(*ans)





Fixed code:
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

n = int(input())
# ans = []
# for u in range(1, n+1):
#     cnt = 0
#     for i in range(1, int(n/(u**2))+2):
#         for j in range(1,int(u/(i**2))+2):
#             for k in range(1,int(u/(j**2))+2):
#                 if i**2+j**2+k**2+i*j+j*k+k*i == u:
#                     if i == j == k:
#                         cnt += 1
#                     elif i != j and j != k and k != j:
#                         cnt += 6
#                     else:
#                         cnt += 3
#
#     ans.append(cnt)
# print(ans)
ans = [0] * (n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            cal = i**2+j**2+k**2+i*j+j*k+k*i
            if cal <= n:
                ans[cal] += 1
for i in range(1, n+1):
    print(ans[i])
Buggy code:
import itertools
ln = itertools.product(range(1,31),repeat = 3)
#print(ln)
line = [0 for i in range(1000)]
print(len(line))
for i in ln:
    x,y,z = i
    n = x**2 +y**2 + z**2 +x*y + y*z + z*x
    if n <=1000:
        line[n-1]+=1
N = int(input())
for i in range(N):
    print(line[i])
        

Fixed code:
import itertools
ln = itertools.product(range(1,100),repeat = 3)
#print(ln)
line = [0 for i in range(10000)]
#print(len(line))
for i in ln:
    x,y,z = i
    n = x**2 +y**2 + z**2 +x*y + y*z + z*x
    if n <=10000:
        line[n-1]+=1
N = int(input())
for i in range(N):
    print(line[i])
Buggy code:
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())

d = [0]*(10**6 + 1)

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

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


Fixed code:
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())

d = [0]*(10**6 + 1)

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

for i in range(1,N+1):
    print(d[i])
Buggy code:
n = int(input())
from itertools import product
l = list(range(1, 100+1))
f = [0 for _ in range(11000)]
def func(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for x, y, z in product(l, l, l):
    v = func(x,y,z)
    if v <= n:
        f[v] += 1
for ans in f[:n]:
    print(ans)


Fixed code:
n = int(input())
from itertools import product
l = list(range(1, 100+1))
f = [0 for _ in range(11000)]
def func(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for x, y, z in product(l, l, l):
    v = func(x,y,z)
    if v <= n:
        f[v] += 1
for ans in f[1:n+1]:
    print(ans)
Buggy code:
N=int(input())
import math
ans=[0]*N
n=int(math.sqrt(N))+1
for i in range(1,n+1):
    if i*i +2*i >N:
        break
    for j in range(1,n+1):
        if i*i+j*j+i*j>N:
            break
        for k in range(1,n+1):
            if i*i+j*j+k*k+i*j+j*k+i*k>N:
                break
            else:
                #print(i*i+j*j+k*k+i*j+j*k+i*k,i,j,k)
                ans[i*i+j*j+k*k+i*j+j*k+i*k]+=1
for i in ans:
    print(i)

Fixed code:
N=int(input())
import math
ans=[0]*(N+1)
n=int(math.sqrt(N))+1
for i in range(1,n+1):
    if i*i +2*i >N:
        break
    for j in range(1,n+1):
        if i*i+j*j+i*j>N:
            break
        for k in range(1,n+1):
            if i*i+j*j+k*k+i*j+j*k+i*k>N:
                break
            else:
                #print(i*i+j*j+k*k+i*j+j*k+i*k,i,j,k)
                ans[i*i+j*j+k*k+i*j+j*k+i*k]+=1
for i in range(len(ans)):
    if i!= 0:
        print(ans[i])
Buggy code:
from math import sqrt, floor

N = int(input())
d = [0] * (N+1)

k = floor(sqrt(N))
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            c = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= c <= N:
                d[c] += 1


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

Fixed code:
from math import sqrt, floor

N = int(input())
d = [0] * (N+1)

k = floor(sqrt(N))
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            c = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= c <= N:
                d[c] += 1


for i in range(1, N+1):
    print(d[i])
Buggy code:
N = int(input())

counts = [0] * 10001
for i in range(1, 311):
    for j in range(1, i + 1):
        for k in range(1, j + 1):
            result = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if result > 10000:
                continue
            if i == j and j == k:
                counts[result] += 1
            elif i == j or j == k:
                counts[result] += 3
            else:
                counts[result] += 6

for n in range(1, N + 1):
    print(counts[n])

Fixed code:
N = int(input())

counts = [0] * 10001
for i in range(1, 101):
    for j in range(1, i + 1):
        for k in range(1, j + 1):
            result = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if result > 10000:
                continue
            if i == j and j == k:
                counts[result] += 1
            elif i == j or j == k:
                counts[result] += 3
            else:
                counts[result] += 6

for n in range(1, N + 1):
    print(counts[n])
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*i;
            
            if v<10050:
            ans[v]+=1

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

Fixed code:
n = int(input())
ans = [0 for a 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:
#import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
def main():
    N = int(input())
    f = [{} for _ in range(N+1)] # [{arg:k}]
    f[6] = {(1,1,1):1}
    for i in range(N):
        args = f[i]
        for (x,y,z),k in args.items():
            index = i + 2*x + y + z + 1
            arg = (x+1,y,z)
            if index < N+1:
                f[index].update({arg: f[index].get(arg,0)+k})
            index = i + x + 2*y + z + 1
            arg = (x,y+1,z)
            if index < N+1:
                f[index].update({arg: f[index].get(arg,0)+k})
            index = i + x + y + 2*z + 1
            arg = (x,y,z+1)
            if index < N+1:
                f[index].update({arg: f[index].get(arg,0)+k})

    #print(f)
    for i in range(1,N+1):
        print(sum(f[i].values()))


main()


Fixed code:
#import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
def main():
    N = int(input())
    f = [{} for _ in range(N+1)] # [{arg:k}]
    if len(f) > 6:
        f[6] = {(1,1,1):1}
    for i in range(N):
        args = f[i]
        for (x,y,z),k in args.items():
            index = i + 2*x + y + z + 1
            arg = (x+1,y,z)
            if index < N+1:
                f[index][arg] = 1
            index = i + x + 2*y + z + 1
            arg = (x,y+1,z)
            if index < N+1:
                f[index][arg] = 1
            index = i + x + y + 2*z + 1
            arg = (x,y,z+1)
            if index < N+1:
                f[index][arg] = 1

    for i in range(1,N+1):
        print(sum(f[i].values()))


main()
Buggy code:
import numpy as np
import math

def func(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x

def count_xyz(n):
    counts = np.zeros(n + 1, dtype=int)
    for x in range(1, math.ceil(math.sqrt(n)) + 1):
        if func(x, x, x) > n:
                break
        for y in range(x, math.ceil(math.sqrt(n)) + 1):
            if func(x, y, y) > n:
                    break
            for z in range(y, math.ceil(math.sqrt(n)) + 1):
                if func(x, y, z) > n:
                    break
                if len({x, y, z}) == 1:
                    counts[func(x, y ,z)] += 1
                elif  len({x, y, z}) == 2:
                    counts[func(x, y ,z)] += 3
                else:
                    counts[func(x, y ,z)] += 6
    
    return counts


def main():
    N = int(input())
    counts = count_xyz(N)
    for i in range(1, N):
        print(counts[i])

if __name__ == "__main__":
    main()

Fixed code:
import numpy as np
import math

def func(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x

def count_xyz(n):
    counts = np.zeros(n + 1, dtype=int)
    for x in range(1, math.ceil(math.sqrt(n)) + 1):
        if func(x, x, x) > n:
                break
        for y in range(x, math.ceil(math.sqrt(n)) + 1):
            if func(x, y, y) > n:
                    break
            for z in range(y, math.ceil(math.sqrt(n)) + 1):
                if func(x, y, z) > n:
                    break
                if len({x, y, z}) == 1:
                    counts[func(x, y ,z)] += 1
                elif  len({x, y, z}) == 2:
                    counts[func(x, y ,z)] += 3
                else:
                    counts[func(x, y ,z)] += 6
    
    return counts


def main():
    N = int(input())
    counts = count_xyz(N)
    for i in range(1, N + 1):
        print(counts[i])

if __name__ == "__main__":
    main()
Buggy code:

import math
def func(x,y,z):
    ans = x**2 + y**2 + z**2+ x*y + y*z + z*x
    return ans

N = int(input())
array_N = [0]*N
root_n = round(math.sqrt(n+1))

for x in range(1,root_n):
    for y in range(1,root_n):
        for z in range(1,root_n):
            if func(x,y,z) <= N:
                array_N[func(x,y,z)-1] =array_N[func(x,y,z)-1] +1
                
for i in range(N):
    print(array_N[i])
                
                

Fixed code:

import math
def func(x,y,z):
    ans = x**2 + y**2 + z**2+ x*y + y*z + z*x
    return ans

N = int(input())
array_N = [0]*N
root_n = round(math.sqrt(N+1))

for x in range(1,root_n):
    for y in range(1,root_n):
        for z in range(1,root_n):
            if func(x,y,z) <= N:
                array_N[func(x,y,z)-1] = array_N[func(x,y,z)-1] +1
                
for i in range(N):
    print(array_N[i])
Buggy code:
n = int(input())
list_ = [0]*1000000
for i in range(100):
   for j in range(100):
       for k in range(100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[i])


Fixed code:
n = int(input())
list_ = [0]*1000000
for i in range(1,100):
   for j in range(1,100):
       for k in range(1,100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[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):
            tmp = x*x+y*y+z*z+x*y+y*z+z*x
            if 1 <= tmp <= N:
                ans[tmp] += 1
for i in ans:
    print(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):
            tmp = x*x+y*y+z*z+x*y+y*z+z*x
            if 1 <= tmp <= N:
                ans[tmp] += 1
for i in range(1,N+1):
    print(ans[i])
Buggy code:
N=int(input())

a=[0]*10**4

for x in range(1,100):
     for y in range(1,100):
         for z in range(1,100):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             if n<=10000:
                 a[n-1]+=1

for n in range(1,N+1):
    print(a[n])







Fixed code:
N=int(input())

a=[0]*10**4

for x in range(1,100):
     for y in range(1,100):
         for z in range(1,100):
             n=(x+y+z)**2-(x*y+y*z+z*x)
             if n<=10000:
                 a[n-1]+=1

for n in range(N):
    print(a[n])
Buggy code:
n = int(input())

ans = [0]*60001

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


Fixed code:
n = int(input())

ans = [0]*60001

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            a = i**2+j**2+k**2+i*j+i*k+j*k
            ans[a]+=1
for i in range(1,n+1):
    print(ans[i])
Buggy code:

N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

num=np.zeros(10**4+1)
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
            if ans < 10**4+1:
                num[ans]+=1


for i in range(N):
    print(int(num[i+1]))


Fixed code:
import numpy as np

N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

num=np.zeros(10**4+1)
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
            if ans < 10**4+1:
                num[ans]+=1


for i in range(N):
    print(int(num[i+1]))
Buggy code:
n=int(input())
d={}
for i in range(1,100):
    for j in range(i,100):
        if i**2>n or j**2>n: break
        for k in range(j,100):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            if tmp>n: break
            if i==k: x=1
            elif i==j or j==k: x=3
            else: x=6
            if tmp in d: d[tmp]+=x
            else: d[tmp]=x
for i in range(1,n+1):
    if i in d: print(d[i]

Fixed code:
n=int(input())
d={}
for i in range(1,100):
    if i**2>n: break
    for j in range(i,100):
        if j**2>n: break
        for k in range(j,100):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            if tmp>n: break
            if i==k: x=1
            elif i==j or j==k: x=3
            else: x=6
            if tmp in d:
                d[tmp]+=x
            else:
                d[tmp]=x
for i in range(1,n+1):
    if i in d: print(d[i])
    else: print(0)
Buggy code:
n = int(input())
ans = [0] * (n+1)

f = int(math.sqrt(n)) + 1
for x in range(1, f):
    for y in range(1, f):
        for z in range(1, f):
            v = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if v < n + 1:
                ans[v] += 1
            
for i in range(n):
    print(ans[i+1])

Fixed code:
import math

n = int(input())
ans = [0] * (n+1)

f = int(math.sqrt(n)) + 1
for x in range(1, f):
    for y in range(1, f):
        for z in range(1, f):
            v = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if v < n + 1:
                ans[v] += 1
            
for i in range(n):
    print(ans[i+1])
Buggy code:
import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math
#import sympy

N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

num=np.zeros(10**4)
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
            if ans < 10**4:
                num[ans]+=1


for i in range(N):
    print(int(num[i]))


Fixed code:
import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math
#import sympy

N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

num=np.zeros(10**4+1)
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
            if ans < 10**4+1:
                num[ans]+=1


for i in range(N):
    print(int(num[i+1]))
Buggy code:
import math
N = int(input())
fn = {i+1:0 for i in range(N)}
rtN = int(math.sqrt(N))+1

def n(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

for x in range(1, rtN):
    for y in range(1, rtN):
        for z in range(1, rtN):
            n_ = n(x,y,z)
            try:
                f[n_] += 1
            except KeyError:
                pass

for k in fn.values():
    print(k)

Fixed code:
import math
N = int(input())
fn = {i+1:0 for i in range(N)}
rtN = int(math.sqrt(N))+1

def n(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

for x in range(1, rtN):
    for y in range(1, rtN):
        for z in range(1, rtN):
            n_ = n(x,y,z)
            try:
                fn[n_] += 1
            except KeyError:
                pass

for k in fn.values():
    print(k)
Buggy code:
N = int(input())

a = [0]* N

x = [i for i in range(1,43)]
y = [i for i in range(1,43)]
z = [i for i in range(1,43)]
ans = []
for i in x:
    for j in y:
        for k in z:
            t = (i**2+j**2+k**2+i*j+j*k+k*i)
            if t <= N:
                a[t] += 1
            
for i in range(N):
    print(a[i])

Fixed code:
N = int(input())

a = [0]* N

x = [i for i in range(1,101)]
y = [i for i in range(1,101)]
z = [i for i in range(1,101)]
ans = []
for i in x:
    for j in y:
        for k in z:
            t = (i**2+j**2+k**2+i*j+j*k+k*i)
            if t <= N:
                a[t-1] += 1
            
for i in range(N):
    print(a[i])
Buggy code:
f = lambda x, y, z: (x + y + z) ** 2 - x * y - y * z - z * x - 1

n = int(input())
a = [0] * n
z = 1
while f(1, 1, z) < n:
  y = 1
  while y < z and f(1, y, z) < n:
    x = 1
    while f(x, y, z) < n:
      a[f(x, y, z)] += 1
      x += 1
    y += 1
  z += 1
print(*a, sep='\n')


Fixed code:
f = lambda x, y, z: (x + y + z) ** 2 - x * y - y * z - z * x - 1

n = int(input())
a = [0] * n
z = 1
while f(1, 1, z) < n:
  y = 1
  while f(1, y, z) < n:
    x = 1
    while f(x, y, z) < n:
      a[f(x, y, z)] += 1
      x += 1
    y += 1
  z += 1
print(*a, sep='\n')
Buggy code:
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num < N:
                arr[num - 1] += 1

print(*arr, sep='\n')



Fixed code:
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num <= N-1:
                arr[num] += 1

print(*arr, sep='\n')
Buggy code:
import itertools
import math
import collections

def func(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
 
n = int(input())
s = int(math.sqrt(n))
nums = list(range(1,s))
arr = []
com = list(itertools.product(nums, repeat=3))
for i in range(len(com)):
    # print(com)
    ans = func(com[i][0],com[i][1],com[i][2])
    arr.append(ans)
 

c = collections.Counter(arr)
for i in range(n):
    print(c[i])

Fixed code:
import itertools
import math
import collections

def func(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
 
n = int(input())
s = int(math.sqrt(n))
nums = list(range(1,s))
arr = []
com = list(itertools.product(nums, repeat=3))
for i in range(len(com)):
    # print(com)
    ans = func(com[i][0],com[i][1],com[i][2])
    arr.append(ans)
 

c = collections.Counter(arr)
for i in range(n):
    print(c[i+1])
Buggy code:
import itertools
import math
import collections
​
def main():
    n = int(input())
​
    s = int(math.sqrt(n))
    a = list(itertools.product(range(1,s),repeat=3))
​
    ans = []
    for i in range(len(a)):
        t = a[i][0] ** 2 + a[i][1] ** 2 + a[i][2] ** 2 + a[i][0] * a[i][1] + a[i][1] * a[i][2] + a[i][2] * a[i][0]
        ans.append(t)
        # print(ans)
​
    c = collections.Counter(ans)
    for i in range(1,n+1):
        print(c[i])
        
        
main()

Fixed code:
import itertools
import math
import collections
def main():
    n = int(input())
    s = int(math.sqrt(n))
    a = list(itertools.product(range(1,s),repeat=3))
    ans = []
    for i in range(len(a)):
        t = a[i][0] ** 2 + a[i][1] ** 2 + a[i][2] ** 2 + a[i][0] * a[i][1] + a[i][1] * a[i][2] + a[i][2] * a[i][0]
        ans.append(t)
        # print(ans)
    c = collections.Counter(ans)
    for i in range(1,n+1):
        print(c[i])
        
        
main()
Buggy code:
from collections import deque
from copy import copy

N = int(input())
result = [0]*N

if N < 6:
    for i in range(N):
        print(0)
    exit()

result[5] += 1

coord = deque()
coord.append([[1,1,1], 6, 0])

while len(coord):
    sol, ans, level = coord.popleft()
    for i in range(level, 3):
        new_sol = copy(sol)
        new_sol[i] += 1
        new_ans = ans + sum(sol) + sol[i] + 1
        if new_ans <= N:
            coord.append([new_sol, new_ans, i])
            result[new_ans] += 1

print(*result, sep='\n', end='')



Fixed code:
from collections import deque
from copy import copy

N = int(input())
result = [0]*N

if N < 6:
    for i in range(N):
        print(0)
    exit()

result[5] += 1

coord = deque()
coord.append([[1, 1, 1], 6, 0])

while len(coord):
    sol, ans, level = coord.popleft()
    for i in range(level, 3):
        new_sol = copy(sol)
        new_sol[i] += 1
        new_ans = ans + sum(sol) + sol[i] + 1
        if new_ans <= N:
            coord.append([new_sol, new_ans, i])
            result[new_ans-1] += 1

print(*result, sep='\n', end='')
Buggy 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):
      a = x**2+y**2+z**2+x*y+y*z+z*x
      if a <= n:
        ans[a] += 1
for i in range(n+1):
  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):
      a = x**2+y**2+z**2+x*y+y*z+z*x
      if a <= n:
        ans[a] += 1
for i in range(1,n+1):
  print(ans[i])