Problem:
 Score : 300 points    Problem Statement Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:   1 \leq x,y,z  x^2 + y^2 + z^2 + xy + yz + zx = n   Given an integer N , find each of f(1),f(2),f(3),\ldots,f(N) .      Constraints  All values in input are integers.  1 \leq N \leq 10^4         Input Input is given from Standard Input in the following format:  N       Output Print N lines. The i -th line should contain the value f(i) .        Sample Input 1 20      Sample Output 1 0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0   For n=6 , only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1 .  For n=11 , three triples, (1,1,2) , (1,2,1) , and (2,1,1) , satisfy both of the conditions. Thus, f(6) = 3 .  For n=17 , three triples, (1,2,2) , (2,1,2) , and (2,2,1) , satisfy both of the conditions. Thus, f(17) = 3 .  For n=18 , three triples, (1,1,3) , (1,3,1) , and (3,1,1) , satisfy both of the conditions. Thus, f(18) = 3 .

Solution (Python):
n = int(input())
ans = [0 for _ in range(10001)]
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            summ = i**2 + j**2 + k**2 + i * j + j * k + k * i
            if summ < 10001:
                ans[summ] += 1

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

Solution (Python):
import sys
import numpy as np
import numba
from numba import njit
i8 = numba.int64

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

@njit((), cache=True)
def compute():
    f = np.zeros(10_001, np.int64)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x * x + y * y + z * z + x * y + x * z + y * z
                if n > 10000:
                    continue
                f[n] += 1
    return f

f = compute()

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

Solution (Python):


n = int(input())

list_ = [0]*(10**4)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <= 10**4:
                list_[a-1] += 1

for i in range(n):
    print(list_[i])

Solution (Python):
def main():
    n = int(input())
    f = [0] * n
    for x in range(1, n):
        if x * x > n:
            break
        for y in range(1, n):
            if x * x + y * y + x * y > n:
                break
            for z in range(1, n):
                if x * x + y * y + z * z + x * y + y * z + z * x > n:
                    break
                f[x * x + y * y + z * z + x * y + y * z + z * x - 1] += 1
    print(*f, sep="\n")


if __name__ == '__main__':
    main()

Solution (Python):
def func(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
n=int(input())
L=[0]*100000
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            L[func(x,y,z)]+=1
for i in range(1,n+1):
    print(L[i])

Solution (Python):
import sys

N = int(sys.stdin.readline())


cnt = [0 for i in range(N)]


for x in range(1,N+1):
    if x * x > N:
        continue
    for y in range(1, N+1):
        if x * y > N or y * y > N:
            continue
        for z in range(1, N+1):
            if z * z > N or x * z > N or z * y > N:
                continue

            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n <= N:
                cnt[n-1] += 1

for n in cnt:
    print(n)

Solution (Python):
n = int(input())

dic = {}

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            fn = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if fn in dic:
                dic[fn] = dic[fn] + 1
            else:
                dic[fn] = 1

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

Solution (Python):
def main():
    N = int(input())
    ans = [0]*(N+1)
    for x in range(1, N+1):
        if N < x**2:
            break
        for y in range(1, N+1):
            if N < x**2 + y**2 + x*y:
                break
            for z in range(1, N+1):
                if N < x**2 + y**2 + z**2 + x*y + y*z + z*x:
                    break
                ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7

    N = int(input())
    ans = [0]*(N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                if x*x + y*y + z*z + x*y + y*z + z*x > N:
                    break
                else:
                    ans[x*x + y*y + z*z + x*y + y*z + z*x] += 1

    for a in ans[1:]:
        print(a)

if __name__ == '__main__':
    solve()

Solution (Python):
N = int(input())
d = dict()

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

import math
sn = int(math.sqrt(N))

for x in range(1, sn + 2):
    for y in range(1, sn + 2):
        for z in range(1, sn + 2):
            n = calc(x, y, z)
            if n in d:
                d[n] += 1
            else:
                d[n] = 1

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

Solution (Python):
import math

N = int(input())
base = math.ceil(math.sqrt(N))

ans = [0] * (N + 1)

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

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

Solution (Python):

def resolve():
    n = int(input())
    a = [0] * (n+1)

    nn = int(n ** 0.5) + 1
    for x in range(1, nn):
        for y in range(1, nn):
            for z in range(1, nn):
                tmp = x**2 + y**2 + z**2 + x * y + y * z + z * x
                if tmp <= n:
                    a[tmp] += 1
    [print(i) for i in a[1:]]

if __name__ == "__main__":
    resolve()

Solution (Python):
def main():
    import sys
    N=int(sys.stdin.readline())
    L=[0]*(10**4+1)
    for x in range(1,1000):
        for y in range(x,1000):
            for z in range(y,1000):
                r=x**2+y**2+z**2+x*y+y*z+z*x
                if r>10**4:
                    break
                
                c=len(set((x,y,z)))
                if c==3:
                    L[r]+=6
                elif c==2:
                    L[r]+=3
                elif c==1:
                    L[r]+=1


    for t in L[1:N+1]:
        print(t)

main()

Solution (Python):
import sys
input = sys.stdin.readline
from collections import *

N = int(input())
ans = [0]*(10**4+100)

x = 1
while x*x<=10**4:
    y = 1
    
    while x*x+y*y+x*y<=10**4:
        z = 1
        
        while x*x+y*y+z*z+x*y+y*z+z*x<=N:
            ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1
            z += 1
        
        y += 1
    
    x += 1
    
for i in range(1, N+1):
    print(ans[i])

Solution (Python):
n = int(input())

my_dict = dict()

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if tmp in my_dict:
                my_dict[tmp] += 1
            else:
                my_dict[tmp] = 1

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

Solution (Python):
N = int(input())
C = {}
for x in range(1,142):
    for y in range(1,142):
        for z in range(1,142):
            a = (x+y)**2+(y+z)**2+(z+x)**2
            if a%2==0:
                if a//2 not in C:
                    C[a//2]=0
                C[a//2] += 1
for i in range(1,N+1):
    if i in C:
        print(C[i])
    else:
        print(0)

Solution (Python):
N = int(input())
MAX = 10**4
ANS = [0]*(MAX+1)

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = x**2+y**2+z**2+x*y+y*z+z*x
      if(k <= MAX):
        ANS[k] += 1

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

Solution (Python):
n = int(input())
target = [0 for i in range(n)]
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      temp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
      if(temp <= n):
        target[temp - 1] += 1
for i in range(n):
  print(target[i])

Solution (Python):
def calc(x, y, z):
    return (x**2 + y**2 + z**2 + x*y + y*z + z*x)

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

    val = [0] * 100000

    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                val[calc(x,y,z)] += 1

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

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())

def cal(a,b,c):
    return(a**2+b**2+c**2 + a*b+b*c+c*a)

memo = [0]*(10**4)

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            temp = cal(i,j,k)
            if temp <= 10**4:
                memo[temp-1] += 1
for i in memo[:N]:
    print(i)

Solution (Python):
N = int(input())
ans = [0]*(N+1)
for x in range(1, 500):
    for y in range(1, 500):
        for z in range(1, 500):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if N >= tmp:
                ans[tmp] += 1
for a in ans[1:]:
    print(a)

Solution (Python):
from collections import defaultdict
import math
n = int(input())

m = int(math.sqrt(n)) + 1
d = defaultdict(int)
for i in range(1, m):
    for j in range(1, m):
        for k in range(1, m):
            d[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1, n+1):
    print(d[i])

Solution (Python):
from collections import defaultdict as dd
n = int(input())
counter = dd(int)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            ans = x**2 + y**2 + z**2 + x*y + y*z + z*x
            counter[ans] += 1

for num in range(1, n+1):
    print(counter[num])

Solution (Python):
N = int(input())
cnt = [0 for i in range(N+1)]

for x in range(1, 110):
    for y in range(1, 110):
        for z in range(1, 110):
            a = x*x + y*y + z*z +z*x + z*y + x*y
            if a <= N:
                cnt[a] += 1

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

Solution (Python):
N = int(input())

F = [0]*(N+1)
N2 = int(N**0.5)

for x in range(1, N2+1):
    n = x**2

    for y in range(1, N2+1):
        n2 = n + y**2 + x*y
        if n2 > N:
            break

        for z in range(1, N2+1):
            n3 = n2 + z**2 + y*z + z*x
            if n3 > N:
                break

            F[n3] += 1


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

Solution (Python):
ans = [0]*(10**4 + 1)

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            memo = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if memo <= 10**4:
                ans[memo] += 1


N = int(input())

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

Solution (Python):
N = int(input())
ans = [0] * (N+1)
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            n = x*x + y*y + z*z + x*y + y*z + z*x
            if 1 <= n <= N:
                ans[n] += 1
print(*ans[1:], sep='\n')

Solution (Python):

from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N = I()
    d = defaultdict(int)

    for x in range(1, int(math.sqrt(N)) + 1):
        for y in range(1, int(math.sqrt(N)) + 1):
            for z in range(1, int(math.sqrt(N)) + 1):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                d[tmp] += 1
    for i in range(1, N+1):
        print(d[i])


if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict
from itertools import product

N = int(input())

f = defaultdict(int)
for x, y, z in product(range(1, 100), repeat=3):
    n = x * x + y * y + z * z + x * y + y * z + z * x
    f[n] += 1

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

Solution (Python):
N=int(input())
list=[0 for i in range(10**4+1)]
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      f=i**2+j**2+k**2+i*j+i*k+j*k
      if f<10**4+1:
        list[f]+=1
for i in range(1,N+1):
      print(list[i])

Solution (Python):
from math import sqrt,ceil
def resolve():
    N =int(input())
    table=[0]*(N+1)
    mx = ceil(sqrt(N))
    for x in range(1,mx):
        for y in range(1,mx):
            for z in range(1,mx):
                n = x**2 + y**2 +z**2 +x*y+y*z +z*x

                if n > N:
                    break
                table[n]+=1

    for i in table[1:]:
        print(i)

resolve()

Solution (Python):
def main():
  ans = [0] *100000
  for i in range(1,  101):
    for j in range(1, 101):
      for k in range(1, 101):
        ans[i**2 + j**2 + k**2 + i*j + j*k + k*i-1] +=1
  n = int(input())
  for i in range(n):
    print(ans[i])
  
if __name__ == "__main__":
  main()

Solution (Python):
n = int(input())

res = []
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            s = i**2 + j**2 + k**2 + i*j + j*k + k*i
            res.append(s)

from collections import Counter
count = Counter(res)

for l in range(1,n+1):
    print(count[l])

Solution (Python):
import sys

N = int(sys.stdin.readline().strip())

ans = [0] * (10000+1)

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

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

Solution (Python):
n = 100
a = []
for i in range(1,n):
    for j in range(1,n):
        for k in range(1,n):
            a.append(i**2+j**2+k**2+i*j+j*k+k*i)

from collections import Counter
u = Counter(a)

n = int(input())
for i in range(1,n+1):
    if i in u.keys():
        print(u[i])
    else:
        print(0)

Solution (Python):
n=int(input())
res=[0]*(n+1)
for x in range(1,150):
  for y in range(1,150):
    for z in range(1,150):
      t = x**2+y**2+z**2+x*y+y*z+z*x
      if t > n:
        continue
      res[t]+=1
for i in range(1,n+1):
  print(res[i])

Solution (Python):
def main():
    n = int(input())
    ans = [0 for i in range(n)]
    m = 0
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                t = x**2+y**2+z**2+x*y+y*z+z*x
                if t>m:
                    m = t
                if t<n+1:
                    ans[t-1]+=1
    for i in range(n):
        print(ans[i])

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())

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

for i in range(1,100):
  for j in range(1,i+1):
    for k in range(1,j+1):
      value = i**2+j**2+k**2+i*j+j*k+k*i
      if value <= 10**4:
        if len(set([i,j,k])) == 3:
          li[value] += 6
        elif len(set([i,j,k])) == 2:
          li[value] += 3
        else:
          li[value] += 1

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

Solution (Python):
def resolve():
    N = int(input())
    cnts = [0] * (10**4 + 1)
    for i in range(1, 100):
        for j in range(1, 100):
            for k in range(1, 100):
                num = i * i + j * j + k * k + i * j + j * k + i * k
                if num <= 10**4:
                    cnts[num] += 1
    for i in range(1, N + 1):
        print(cnts[i])


resolve()

Solution (Python):
n=int(input())
ans=[0 for i in range(1+10**5)]
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            a=i**2+j**2+k**2+i*j+j*k+k*i
            ans[a]+=1
for i in range(1,n+1):
    print(ans[i])

Solution (Python):
import sys
import math
import bisect

def main():
    n = int(input())
    A = [0] * (n + 1)
    m = 0
    while (m + 1) ** 2 <= n:
        m = m + 1
    for x in range(1, m + 1):
        for y in range(1, m + 1):
            for z in range(1, m + 1):
                val = x*x + y*y + z*z + x*y + y*z + z*x
                if val >= 1 and val <= n:
                    A[val] += 1
    for i in range(1, n + 1):
        print(A[i])

if __name__ == "__main__":
    main()

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




N = int(input())

max_n = 100
ans = defaultdict(int)

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

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

Solution (Python):
n = int(input())
dp = [0] * 60005
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            dp[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1

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

Solution (Python):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right,bisect
n=int(input())
ans=defaultdict(lambda:0)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ans[x*x +y*y +z*z +x*y +y*z+x*z]+=1
for i in range(1,n+1):
    print(ans[i])

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    res = [0 for i in range(n)]

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

    res = "\n".join([str(r) for r in res])
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)

Solution (Python):
N = int(input())
li = [0 for i in range(N+10)]

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

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

Solution (Python):
N = int(input())
ans = [0] * N
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x - 1
            if n < N:
                ans[n] += 1
for i in ans:
    print(i)

Solution (Python):
n = int(input())

cnt = [0] * (n+1)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if val > n:
                continue
            cnt[val] += 1

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

Solution (Python):
A=[0]*(10**4+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            a=i**2+j**2+k**2+i*j+j*k+k*i
            if a<=10**4:
                A[a]+=1
n=int(input())
for i in range(n):
    print(A[i+1])

Solution (Python):
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for i in range(1, int(N**0.5)+1):
    for j in range(1, int(N**0.5)+1):
        for k in range(1, int(N**0.5)+1):
            t = i**2 + j**2 + k**2 + i*j + j*k + k*i
            d[t] += 1
for i in range(1, N+1):
    print(d[i])

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
l = [0]*10001
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            num = x**2+y**2+z**2+x*y+y*z+z*x
            if num < 10001:
                if x==y and y==z:
                    l[num] += 1
                elif x==y or y==z:
                    l[num] += 3
                else:
                    l[num] += 6

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

Solution (Python):
from collections import defaultdict
def main():
    n = int(input())
    d = defaultdict(int)
    sn = int(n ** 0.5)
    for x in range(1, sn + 1):
        for y in range(x, sn + 1):
            for z in range(y, sn + 1):
                a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                b = len(set([x, y, z]))
                if b == 1:
                    d[a] += 1
                elif b == 2:
                    d[a] += 3
                else:
                    d[a] += 6
    [print(d[i]) for i in range(1, n + 1)]


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

ans = [0 for _ in range(10001)]

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

Solution (Python):
import sys
input = sys.stdin.readline




'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

n=int(input())
ans=[0]*n
for i in range(1,int(n**(1/2))+1):
    for j in range(1,int(n**(1/2))+1):
        for k in range(1,int(n**(1/2))+1):
            if i**2+j**2+k**2+i*j+j*k+k*i<n+1:
                ans[i**2+j**2+k**2+i*j+j*k+k*i-1]+=1
for i in range(n):
    print(ans[i])

Solution (Python):
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):
            K = x**2+y**2+z**2+x*y+y*z+z*x
            if 1 <= K <= N:
                ans[K] += 1 
for i in range(1,N+1):
    print(ans[i])

Solution (Python):
N = int(input())

F = [0]*(N+1)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            c = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if (c <= N):
                F[c] += 1
print(*F[1:], sep='\n')

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter



import bisect
n=int(input())
ans=[0]*n
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            res=x**2+y**2+z**2+x*y+y*z+z*x
            if res>n:
              continue
            if x==y==z:
                ans[res-1]+=1
            elif (x==y and y!=z) or (y==z and x!=y):
                ans[res-1]+=3
            elif x!=y and y!=z:
                ans[res-1]+=6
for i in range(n):
    print(ans[i])

Solution (Python):
def main():
    N = int(input())
    count = [0]*(N)
    for x in range(1, int(N**0.5)+2):
        for y in range(1, int(N**0.5)+2):
            for z in range(1, int(N**0.5)+2):
                res = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if res <= N:
                    count[res-1] += 1
    print(*count, sep="\n")
if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
n = int(N**0.5)
d = {}
for x in range(1, n+1):
    for y in range(1, n+1):
        for z in range(1, n+1):
            c = x**2+y**2+z**2+x*y+y*z+z*x
            if c not in d:
                d[c] = 1
            else:
                d[c]+=1
for i in range(1, N+1):
    if i not in d:
        print(0)
    else:
        print(d[i])

Solution (Python):
N = int(input())

V = [0]*10000

for j in range (1, 100):
    for k in range (1, 100):
        for l in range (1, 100):
            if j**2+k**2+l**2+j*k+k*l+j*l < 10001:
                V[j**2+k**2+l**2+j*k+k*l+j*l-1]+=1

for i in range (0, N):
    print(V[i])

Solution (Python):
n = 10 ** 2 + 1
a = {}
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            f = x**2 + y ** 2 + z ** 2 + x*y + y*z + z*x
            a.setdefault(f, 0)
            a[f] += 1
N = int(input())
for i in range(1, N + 1):
    a.setdefault(i, 0)
    print(a[i])

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()

a = [0]*n
for i in range(1,int(n**0.5)+1):
    for j in range(1,int(n**0.5)+1):
        for k in range(1,int(n**0.5)+1):
            if i**2+j**2+k**2+i*j+j*k+k*i <= n:
                a[i**2+j**2+k**2+i*j+j*k+k*i-1] += 1

for i in a:
    print(i)

Solution (Python):
n = int(input())
l = [0]*(10**7)
for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      l[x**2+y**2+z**2+x*y+y*z+z*x] += 1

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

Solution (Python):
from collections import defaultdict

n = int(input())

d = defaultdict(int)

for i in range(1, 120):
    for j in range(1, 120):
        for k in range(1, 120):
            num = i**2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            d[num] += 1

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd, cos, radians, floor
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



MAX = 10 ** 2
n = int(input())    
ans = [0 for i in range(n)]
for x in range(1, MAX + 1):
    for y in range(1, MAX + 1):
        for z in range(1, MAX + 1):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if 0 <= a - 1 < n:
                ans[a - 1] += 1
for i in range(n):
    print(ans[i])

Solution (Python):




import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

N = int(input())

f = [0]*(N+1)

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

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

Solution (Python):
N = int(input())
a = 100
ans = [0]*N
for x in range(1,a):
    for y in range(1,a):
        for z in range(1,a):
            res = x**2 + y **2 + z**2 + x*y + y*z + z*x
            if res <=N:
                ans[res-1]+=1
for i in ans:
    print(i)

Solution (Python):
N = int(input())

ans = [0] * 10**4
for x in range(1, 110):
    for y in range(1, 110):
        for z in range(1, 110):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= 10**4:
                ans[n-1] += 1
                
for i in range(N):
    print(ans[i])

Solution (Python):
n = int(input())
a = [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+j*k+k*i]+=1
for i in a[1:n+1]:
  print(i)

Solution (Python):
n = int(input())
f = []
for _ in range(10000):
    f.append(0)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            id = x*x + y*y + z*z + x*y + y*z + z*x
            if id <= 10000:
                f[id-1] += 1
for i in range(n):
    print(f[i])

Solution (Python):
n = int(input())
ansl = [0 for _ in range(n+1)]
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			targ = x**2 + y**2 + z**2 + x*y + y*z + z*x
			if targ <= n:
				ansl[targ] += 1
for i in range(1, n+1):
	print(ansl[i])

Solution (Python):
N = int(input())

ans = [0]*10**4
for x in range(1,101):
    for y in range(1,int(N**0.5)+1):
        for z in range(1,int(N**0.5)+1):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                ans[n-1]+=1

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