qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
cs = [0]*N
for i in range(1,130):
    for j in range(1,130):
        for k in range(1,130):
            temp = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if temp =< N and temp > 0:
                cs[temp-1] += 1
for i in range(N):
    print(cs[i])


Fixed code:
N = int(input())
cs = [0]*N
for i in range(1,130):
    for j in range(1,130):
        for k in range(1,130):
            temp = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if temp <= N and temp > 0:
                cs[temp-1] += 1
for i in range(N):
    print(cs[i])
Buggy code:
N = int(input())
ans = [0]*((10**4)+1)

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

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


Fixed code:
N = int(input())
ans = [0]*((10**4)+1)

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

for i in range(N):
    print(ans[i+1])
Buggy code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N = int(readline())

    f = [0] * (N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                tmp = x*x + y*y + z*z + x*y + y*z + z*x - 1
                if tmp > N:
                    break
                f[tmp] += 1
    
    print("\n".join(map(str, f)))


if __name__ == "__main__":
    main()


Fixed code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N = int(readline())

    f = [0] * (N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                tmp = x*x + y*y + z*z + x*y + y*z + z*x
                if tmp <= N:
                    f[tmp] += 1
    
    print("\n".join(map(str, f[1:])))


if __name__ == "__main__":
    main()
Buggy code:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def solve(n):
    result = [0] * n
    for i in range(1, n+1):
        i2 = pow(i, 2)
        for j in range(i, n+1):
            j2 = pow(j, 2)
            for k in range(j, n+1):
                k2 = pow(k, 2)
                curr = i2 + j2 + k2 + i*j + i*k + j*k
                if curr > n:
                    break
                count = 6
                if i == j and i == k:
                    count = 1
                elif i == j or i == k:
                    count = 3
                result[curr-1] += count
    return result


if __name__ == "__main__":
    n = int_in()
    result = solve(n)
    for item in result:
        out(item)

Fixed code:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def solve(n):
    result = [0] * n
    for i in range(1, n+1):
        i2 = pow(i, 2)
        for j in range(i, n+1):
            j2 = pow(j, 2)
            for k in range(j, n+1):
                k2 = pow(k, 2)
                curr = i2 + j2 + k2 + i*j + i*k + j*k
                if curr > n:
                    break
                count = 6
                if i == j and i == k:
                    count = 1
                elif i == j or i == k or j == k:
                    count = 3
                result[curr-1] += count
    return result


if __name__ == "__main__":
    n = int_in()
    result = solve(n)
    for item in result:
        out(item)
Buggy code:
N=int(input())
count=[0]*(10**4+1)
for x in range(1,10**2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                count[n]+=1
for i in range(1,N):
    print(count[i])

Fixed code:
N=int(input())
count=[0]*(10**4+1)
for x in range(1,10**2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                count[n]+=1
for i in range(1,N+1):
    print(count[i])
Buggy code:
import sys
si = sys.stdin.readline


def main():
    n = int(si())
    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+y+z)**2+x**2+y**2+z**2)//2
                if v > 10000:
                    break
                ans[v] += 1

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


if __name__ == '__main__':
    main()


Fixed code:
import sys
si = sys.stdin.readline


def main():
    n = int(si())
    ans = [0 for _ in range(10000+1)]
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                v = ((x+y+z)**2+x**2+y**2+z**2)//2
                if v > 10000:
                    break
                ans[v] += 1

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


if __name__ == '__main__':
    main()
Buggy code:
def solve():
    N = int(input())
    f = lambda x,y,z:x*x+y*y+z*z+x*y+y*z+z*x
    MAX = 10000

    ans = [0]*(MAX+1)
    for x in range(1, 101):
        if f(x,0,0)>MAX:
            break
        for y in range(1, 101):
            if f(x,y,0)>MAX:
                break
            for z in range(1, 101):
                if f(x,y,z)>MAX:
                    break
                ans[f(x,y,z)]+=1
    for i in ans[:N+1]:
        print(i)

if __name__ == "__main__":
    solve()


Fixed code:
def solve():
    N = int(input())
    f = lambda x,y,z:x*x+y*y+z*z+x*y+y*z+z*x
    MAX = 10000

    ans = [0]*(MAX+1)
    for x in range(1, 101):
        if f(x,0,0)>MAX:
            break
        for y in range(1, 101):
            if f(x,y,0)>MAX:
                break
            for z in range(1, 101):
                if f(x,y,z)>MAX:
                    break
                ans[f(x,y,z)]+=1
    for i in range(1, N+1):
        print(ans[i])

if __name__ == "__main__":
    solve()
Buggy code:
n = int(input())
c = [0]*10001

for x in range(1,101):
    if(x > n):
        break
    for y in range(x,101):
        for z in range(y,101):
            p = int(((x+y)*(x+y) + (y+z)*(y+z) + (z+x)*(z+x))/2)
            if(n >= p):
                c[p] += 1

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



Fixed code:
n = int(input())
c = [0]*10001

for x in range(1,101):
    if(x > n):
        break
    for y in range(1,101):
        for z in range(1,101):
            p = int(((x+y)*(x+y) + (y+z)*(y+z) + (z+x)*(z+x))/2)
            if(n >= p):
                c[p] += 1

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

for x in range(1,sqrt_N):
    for y in range(1,sqrt_N):
        for z in range(1,sqrt_N): 
            print(x,y,z)
            xyz = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
            if xyz <= N:
                ans[xyz - 1] = ans[xyz - 1] + 1

[print(i) for i in ans]

Fixed code:
N = int(input())
ans = [0] * N
sqrt_N = (int(N**0.5 + 1))

for x in range(1,sqrt_N):
    for y in range(1,sqrt_N):
        for z in range(1,sqrt_N): 
            xyz = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
            if xyz <= N:
                ans[xyz - 1] = ans[xyz - 1] + 1

[print(i) for i in ans]
Buggy code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y +z*z + x*y + y*z + z*x
    if 6 <= val <= N:
        lst[val-1] += 1
print(*lst[1:],sep="\n")        

Fixed code:
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y + z*z + x*y + y*z + z*x
    if val <= N:
        lst[val-1] += 1
print(*lst,sep="\n")
Buggy code:
L=[]
i=0
while i <10000:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10001:
                L[p]+=1
N=int(input())
for i in range(0,N):
    print(L[i])

Fixed code:
L=[]
i=0
while i <100001:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10001:
                L[p]+=1
N=int(input())
for i in range(1,N+1):
    print(L[i])
Buggy code:
N = int(input())


d={}


for a in range(100):
	for b in range(100):
		z=(a+1)**2+(b+1)**2+(a+1)*(b+1)
		for c in range(100):
			gokei=z+(c+a+3+b)*(c+1)
			if gokei in d:
				d[gokei]+=1
			else:
				d[gokei]=1

for i in range(N):
	if i in d:
		print(d[i])
	else:
		print(0)





Fixed code:
N = int(input())


d={}


for a in range(100):
	for b in range(100):
		z=(a+1)**2+(b+1)**2+(a+1)*(b+1)
		for c in range(100):
			gokei=z+(c+a+3+b)*(c+1)
			if gokei in d:
				d[gokei]+=1
			else:
				d[gokei]=1

for i in range(N):
	if i+1 in d:
		print(d[i+1])
	else:
		print(0)
Buggy code:
n = int(input())
f = [0] * (n + 1)
t = int(n ** .5) + 3
for i in range(1, t):
    for j in range(1, t):
        for k in range(1, t):
            res = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if res <= n:
                f[res] += 1
print('\n'.join(map(str, f)))


Fixed code:
n = int(input())
f = [0] * (n + 1)
t = int(n ** .5) + 3
for i in range(1, t):
    for j in range(1, t):
        for k in range(1, t):
            res = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if res <= n:
                f[res] += 1
print('\n'.join(map(str, f[1:])))
Buggy code:
n = int(input())
rootn = int(n**0.5) +1
ans = [0] * (n+1)
for x in range(1, rootn):
  for y in range(1, rootn):
    for z in range(1, rootn):
      cur = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cur <= n:
        ans[cur] += 1
print('\n'.join(map(str, ans)))

Fixed code:
n = int(input())
rootn = int(n**0.5) +1
ans = [0] * (n+1)
for x in range(1, rootn):
  for y in range(1, rootn):
    for z in range(1, rootn):
      cur = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cur <= n:
        ans[cur] += 1
print('\n'.join(map(str, ans[1:])))
Buggy code:
import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > n:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])

Fixed code:
import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > N:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])
Buggy code:
# coding: utf-8


def main():
    N = int(input())

    fs = [0] * N
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                i = (x**2) + (y**2) + (z**2) + (x+y) + (y+z) + (z+x)
                if i <= N:
                    fs[i-1] += 1

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


main()
# print(main())


Fixed code:
# coding: utf-8


def main():
    N = int(input())

    fs = [0] * N
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                i = (x**2) + (y**2) + (z**2) + (x*y) + (y*z) + (z*x)
                if i <= N:
                    fs[i-1] += 1

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


main()
# print(main())
Buggy code:
n = int(input())
dic = {}
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):
            ans = x**2 + y **2 + z**2 +x*y+y*z+z*x
            if ans in dic:
                dic[ans] +=1
            else:
                dic[ans] = 1

print(dic)

for i in range(n):
    if i+1 in dic:
        print(dic[i+1])
    else:
        print(0)

Fixed code:
n = int(input())
dic = {}
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):
            ans = x**2 + y **2 + z**2 +x*y+y*z+z*x
            if ans in dic:
                dic[ans] +=1
            else:
                dic[ans] = 1

for i in range(n):
    if i+1 in dic:
        print(dic[i+1])
    else:
        print(0)
Buggy code:
N = int(input())
f = {}

for x in range(1, 110):
	for y in range(1, 110):
		for z in range(1, 110):
			t = x*x+y*y+z*z+x*y+y*z+z*x
			f[t] = (f[t]+1 if t in f.keys() else 1)

for i in range(1, N):
    print(f[i] if i in f.keys() else 0)

Fixed code:
N = int(input())
f = {}

for x in range(1, 110):
	for y in range(1, 110):
		for z in range(1, 110):
			t = x*x+y*y+z*z+x*y+y*z+z*x
			f[t] = (f[t]+1 if t in f.keys() else 1)

for i in range(1,N+1):
    print(f[i] if i in f.keys() else 0)
Buggy code:
import sys
import itertools as itr
readline = sys.stdin.buffer.readline



N=int(readline())
n=int(pow(N,0.5))-2
chk=list(itr.product(range(1,n),repeat=3))
cnt=[0]*(N+1)
for _ in range(len(chk)):
  i=chk[_][0]
  j=chk[_][1]
  k=chk[_][2]
  if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
    cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
          

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

Fixed code:
import sys
import itertools as itr
readline = sys.stdin.buffer.readline



N=int(readline())
n=int(pow(N,0.5))
chk=list(itr.product(range(1,n),repeat=3))
cnt=[0]*(N+1)
for _ in range(len(chk)):
  i=chk[_][0]
  j=chk[_][1]
  k=chk[_][2]
  if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
    cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
          

for i in range(1,N+1):
  print(cnt[i])
Buggy code:
#C
import math

N = int(input())


count = [0] * 10050
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v <= 10050:
                count[v] += 1

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

Fixed code:
#C
N = int(input())

count = [0] * 10050
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v < 10050:
                count[v] += 1

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

lis = [0] * (n+1)

s  = int(n**0.5)

for i in range(1, s):
    for j in range(1, s):
        for k in range(1, s):
            t = i**2 + j**2 + k**2 + i*j + j*k + i*k
            tmp = [i,j,k]
            
            if t <= n:
                lis[t] += 1

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

Fixed code:
n = int(input())

lis = [0] * (n+1)

s = int(n ** 0.5)

for i in range(1, s+1):
    for j in range(1, s+1):
        for k in range(1, s+1):
            t = i**2 + j**2 + k**2 + i*j + j*k + i*k
            tmp = [i,j,k]
            
            if t <= n:
                lis[t] += 1

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

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

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




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

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

for i in range(1,n+1):
    print(ans[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*i;
    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:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=6
      if x==y:
        k=3
        if x==z:
          k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)

Fixed code:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=6
      if x==y or y==z:
        k=3
        if x==z:
          k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)
Buggy code:
N = int(input())
ans = [0]*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 + k*i
      if v < 10050:
        ans[v] += 1
for i in range(N+1):
  print(ans[i])

Fixed code:
N = int(input())
ans = [0]*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 + k*i
      if v < 10050:
        ans[v] += 1
for i in range(N):
  print(ans[i+1])
Buggy code:
import math
n = int(input())
nlist = [0]*n
for x in range(1,math.ceil(math.sqrt(n-1)-1)):
    for y in range(1,math.ceil(math.sqrt(n-1)-1)):
        for z in range(math.ceil(math.sqrt(n-1)-1)):
            temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if temp > n:
                break
            else:
                nlist[temp-1] +=1

for num in nlist:
    print(num)


Fixed code:
import math
n = int(input())
nlist = [0]*n
for x in range(1,math.ceil(math.sqrt(n-1)-1)):
    for y in range(1,math.ceil(math.sqrt(n-1)-1)):
        for z in range(1,math.ceil(math.sqrt(n-1)-1)):
            temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if temp > n:
                break
            else:
                nlist[temp-1] +=1

for num in nlist:
    print(num)
Buggy code:
import itertools

n = int(input())

cnt = [0] * (10 ** 4 + 1)

for x, y, z in itertools.product(range(1, 10 ** 2), repeat=3):
    idx = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    if idx <= 10 ** 4:
        cnt[idx] += 1

for num in cnt[1:]:
    print(num)


Fixed code:
import itertools

n = int(input())

cnt = [0] * (10 ** 4 + 1)

for x, y, z in itertools.product(range(1, 10 ** 2), repeat=3):
    idx = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    if idx <= 10 ** 4:
        cnt[idx] += 1


for num in cnt[1 : n + 1]:
    print(num)
Buggy code:
N = int(input())
ans = [0] (N + 1)
for i in range (1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      n = i*i+j*j+k*k+i*j+j*k+k*i
      if n <= N:
        ans[n] += 1

print(*ans[1:], sep='\n')



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

print(*ans[1:], sep='\n')
Buggy code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, 101 - i):
       for k in range(1, 101 - i - j):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(*ans, sep='\n')


Fixed code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, int(N**0.5)+2):
       for k in range(1, int(N**0.5)+2):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(*ans[1:], sep='\n')
Buggy code:
n = int(input())
ans = [0] * 10000
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      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] * 10050
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      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())

res = defaultdict(int)
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
            res[v] += 1

for i in range(n):
    print(res.get(i, 0))


Fixed code:
from collections import defaultdict
n = int(input())

res = defaultdict(int)
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
            res[v] += 1

for i in range(1, n + 1):
    print(res.get(i, 0))
Buggy code:
N = int(input())
L = [0] * N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      n = ((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 
      if n <= N:
        L[n - 1] += 1
print(*L, sep='\n')

Fixed code:
N = int(input())
L = [0] * N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      n = int(((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 )
      if n <= N:
        L[n - 1] += 1
print(*L, sep='\n')
Buggy code:
import itertools
from collections import defaultdict

def main():
    N = int(input())
    A = defaultdict(int)
    for x in range(1,N+1):
        breakflag = False
        for y in range(1,N+1):
            for z in range(1,N+1):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                # print(x,y,z,a,A)
                if a <= N:
                    A[a] += 1
                else:
                    break
    for i in range(N+1):
        print(A[i])

if __name__ == '__main__':
    main()

Fixed code:
import itertools
from collections import defaultdict

def main():
    N = int(input())
    A = defaultdict(int)
    for x in range(1,N+1):
        breakflag = False
        for y in range(1,N+1):
            for z in range(1,N+1):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                # print(x,y,z,a,A)
                if a <= N:
                    A[a] += 1
                else:
                    break
    for i in range(N):
        print(A[i+1])

if __name__ == '__main__':
    main()
Buggy code:
# (x + y + z) ** 2 == n + xy + yz + zx\

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

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

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


Fixed code:
# (x + y + z) ** 2 == n + xy + yz + zx\

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

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

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


Fixed code:
N=int(input())
ans = [0]*10000000
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            ans[i**2+j**2+k**2+i*j+j*k+i*k] += 1
for i in range(1,N+1):
    print(ans[i])