Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import math


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    ans = 0

    for n in range(1, N+1):
        ans = 0
        for i in range(1, math.floor(n**(1/2))+1):
            for j in range(i,  math.floor(n**(1/2))+1):
                for k in range(j,  math.floor(n**(1/2))+1):
                    if (i**2 + j ** 2 + k ** 2 + i*j+j*k+k*i == n):
                        tmp = set([i, j, k])
                        if len(tmp) == 3:
                            ans += 6
                        if len(tmp) == 2:
                            ans += 3
                        if len(tmp) == 1:
                            ans += 1
        print(ans)


        # oj t -c "pypy3 main.py"
        # acc s main.py -- --guess-python-interpreter pypy
main()


Fixed submission:
#!/usr/bin/env python3
import sys
import math
import collections


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    ans = 0
    list_counter = []

    for i in range(1, math.floor(N**(1/2))+1):
        for j in range(i,  math.floor(N**(1/2))+1):
            for k in range(j,  math.floor(N**(1/2))+1):
                n = str(i**2 + j**2 + k**2 + i*j + j*k + k*i)
                tmp = set([i, j, k])

                if len(tmp) == 3:
                    tmp_list = [n]*6
                if len(tmp) == 2:
                    tmp_list = [n]*3
                if len(tmp) == 1:
                    tmp_list = [n]*1
                list_counter.extend(tmp_list)

    counter = collections.Counter(list_counter)
    for n in range(1, N+1):
        print(counter[str(n)])



    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    ans = 0

    for n in range(1, N+1):
        ans = 0
        for i in range(1, n):
            for j in range(i, n):
                for k in range(j, n):
                    if (i**2 + j ** 2 + k ** 2 + i*j+j*k+k*i == n):
                        tmp = set([i, j, k])
                        if len(tmp) == 3:
                            ans += 6
                        if len(tmp) == 2:
                            ans += 3
                        if len(tmp) == 1:
                            ans += 1
        print(ans)

        # oj t -c "pypy3 main.py"
        # acc s main.py -- --guess-python-interpreter pypy
main()


Fixed submission:
#!/usr/bin/env python3
import sys
import math
import collections


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    ans = 0
    list_counter = []

    for i in range(1, math.floor(N**(1/2))+1):
        for j in range(i,  math.floor(N**(1/2))+1):
            for k in range(j,  math.floor(N**(1/2))+1):
                n = str(i**2 + j**2 + k**2 + i*j + j*k + k*i)
                tmp = set([i, j, k])

                if len(tmp) == 3:
                    tmp_list = [n]*6
                if len(tmp) == 2:
                    tmp_list = [n]*3
                if len(tmp) == 1:
                    tmp_list = [n]*1
                list_counter.extend(tmp_list)

    counter = collections.Counter(list_counter)
    for n in range(1, N+1):
        print(counter[str(n)])



    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()