Buggy python submission (verdict: Time Limit Exceeded):
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zer
    ans = [0]*N
    x,y,z = 1,1,1
    a = x**2 + y**2 + z**2 +x*y + y*z + z*x

    for x in range(1,N):
        for y in range(1,N):
            for z in range(1,N):
                a = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if a > N:
                    break
                s = set([x,y,z])
                if len(s) == 1:
                    ans[a-1] = 1
                elif len(s) == 2:
                    ans[a-1] = 3
                else:
                    ans[a-1] = 6

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



if __name__ == '__main__':
    solve()


Fixed submission:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zer
    ans = [0]*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):
                a = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if a > N:
                    break
                ans[a-1] += 1

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



if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    for n in range(1,N+1):
        ans = 0
        for x in range(1,int((n//3)**0.5)+1):
            for y in range(1,int((n//3)**0.5)+1):
                pre = x**2 + y**2 + x*y
                uu = n-pre
                if uu<0:
                    break
                for z in range(1,int(uu**0.5)+1):
                    if z*(z+x+y)==uu:
                        if len(set([x,y,z])) == 1:
                            ans = 1
                            break
                        elif len(set([x,y,z])) == 2:
                            ans = 3
                            break
                        else:
                            ans = 6
                            break
            else:
                continue
            break
        print(ans)



if __name__ == '__main__':
    solve()


Fixed submission:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zer
    ans = [0]*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):
                a = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if a > N:
                    break
                ans[a-1] += 1

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



if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    for n in range(1,N+1):
        ans = 0
        for x in range(1,int((n//3)**0.5)+1):
            for y in range(1,int((n//3)**0.5)+1):
                pre = x**2 + y**2 + x*y
                uu = n-pre
                if uu<0:
                    break
                for z in range(1,int(uu**0.5)+1):
                    if z*(z+x+y)==uu:
                        if len(set([x,y,z])) == 1:
                            ans = 1
                            break
                        elif len(set([x,y,z])) == 2:
                            ans = 3
                            break
                        else:
                            ans = 6
                            break
        print(ans)



if __name__ == '__main__':
    solve()


Fixed submission:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zer
    ans = [0]*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):
                a = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if a > N:
                    break
                ans[a-1] += 1

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



if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    for n in range(1,N+1):
        ans = 0
        for x in range(1,int(n**0.5)+1):
            for y in range(1,int(n**0.5)+1):
                pre = x**2 + y**2 + x*y
                uu = n-pre
                if uu<0:
                    break
                for z in range(1,int(uu**0.5)+1):
                    if z*(z+x+y)==uu:
                        if len(set([x,y,z])) == 1:
                            ans = 1
                            break
                        elif len(set([x,y,z])) == 2:
                            ans = 3
                            break
                        else:
                            ans = 6
                            break
        print(ans)



if __name__ == '__main__':
    solve()


Fixed submission:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zer
    ans = [0]*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):
                a = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if a > N:
                    break
                ans[a-1] += 1

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



if __name__ == '__main__':
    solve()