Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, upper):
    for y in range(1, upper):
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)


Fixed submission:

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
upper = int(math.sqrt(N))
#print(upper)

for n in range(1,N+1):
    myans = 0
    for x in range(1, upper):
        remain = n - x**2
        if remain >= 1:
            y_upper = int(math.sqrt(remain))
            for y in range(1, y_upper+1):
                remain2 = remain - (y**2 + x*y)
                if remain2 >= 1:
                    z_upper = int(math.sqrt(remain2))
                    for z in range(1, z_upper+1):
                        if  z**2 + y*z + z*x == remain2:
                            myans += 1
    print(myans)

Fixed submission:

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
upper = int(math.sqrt(N))
#print(upper)

for n in range(1,N+1):
    myans = 0
    for x in range(1, upper):
        remain = n - x**2
        if remain >= 1:
            y_upper = int(math.sqrt(remain))
            for y in range(1, y_upper):
                if x**2 + y**2 + x*y < n:
                    for z in range(1, upper):
                        if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    #print(x,y,z,x**2 + y**2 + z**2 + x*y + y*z + z*x)
                            myans += 1
    print(myans)

Fixed submission:

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
upper = int(math.sqrt(N)) + 1
#print(upper)

for n in range(1,N+1):
    myans = 0
    for x in range(1, upper):
        for y in range(1, upper):
            if x**2 + y**2 + x*y < n:
                for z in range(1, upper):
                    if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    #print(x,y,z,x**2 + y**2 + z**2 + x*y + y*z + z*x)
                        myans += 1
    print(myans)

Fixed submission:

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
upper = int(math.sqrt(N)) + 1
#print(upper)

for n in range(1,N+1):
    myans = 0
    for x in range(1, upper):
        for y in range(1, upper):
            for z in range(1, upper):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    #print(x,y,z,x**2 + y**2 + z**2 + x*y + y*z + z*x)
                    myans += 1
    print(myans)

Fixed submission:

N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)