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):
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]

N = rri()

ans = [0 for i in range(N)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            if i*i + j*j+k*k+i*j+j*k+i*k<=N:
                ans[i*i + j*j+k*k+i*j+j*k+i*k-1]+=1
for i in ans:
    print i

Solution (Python):
def cin():
    return input().split()
n = int(input())
a = []
for i in range(10001):
    a.append(0)
for x  in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            res = x*x + y*y + z*z + x*y + y*z + z*x
            if res <= 10000:
                a[res] += 1
for i in range(1,n+1):
    print(a[i])

Solution (Python):
def main():
    n = int(input())
    
    res = [0]*(n+1)

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



    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

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

cnt = [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):
            num = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if num <= n:
                cnt[num - 1] += 1
print(*cnt, sep="\n")

Solution (Python):
import numpy as np


def main(N):
    f = [0]*(N+1)
    for x in range(100):
        for y in range(100):
            for z in range(100):
                if (x+y+2)**2+(x+z+2)**2+(z+y+2)**2 > 2*N:
                    break
                f[((x+y+2)**2+(x+z+2)**2+(z+y+2)**2)//2] += 1
    return f


N = int(input())
f = main(N)
for i in range(N):
    print(f[i+1])

Solution (Python):

N = int(input())

counter = [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
            try:
                counter[n - 1] += 1
            except:
                pass
            
for i in range(N):           
    print(counter[i])

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

A = [0 for _ in range(N+1)]
n = int(N ** 0.5) + 1
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            v = x*x + y*y + z*z + x*y + y*z + z*x
            if v <= N:
                A[v] += 1
for i in range(1, N+1):
    print(A[i])

Solution (Python):
results = [0 for i in range(10**5)]
for i in range(1, 10**2):
    for j in range(1, 10**2):
        for k in range(1, 10**2):
            n = i*i + j*j + k*k + i*j + j*k + k*i
            results[n] += 1

N = int(input())
for i in range(1, N+1):
    print(results[i])

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

lst = [0] * 10001

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      i  = x*x + y*y + z*z + x*y + y*z + z*x
      if i < 10001:
      	lst[i] += 1
      
for k in range(N):
  print(lst[k+1])

Solution (Python):
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
f = [0] * N
for x in range(1,100+1):
    for y in range(1, 100+1):
        for z in range(1, 100+1):
            h = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if h > N:
                continue
            f[h - 1] += 1
for i in range(N):
    print(f[i])

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

ans = [0]*(N+1)
for x in range(1, int(N**0.5)):
    for y in range(1, int(N**0.5)):
        for z in range(1, int(N**0.5)):
            S = x**2 + y**2 + z**2 + x*y + y*z + x*z
            if 1 <= S <= N:
                ans[S] += 1
            else:
                break

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

Solution (Python):
n = int(input())
ans = [0 for _ in range(n)]
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
      if s <= n:
        ans[s-1] += 1
for i in range(n):
  print(ans[i])

Solution (Python):
import math

N = int(input())

A = [0] * (N + 1)

for x in range(1, int(math.sqrt(N))):
    for y in range(1, int(math.sqrt(N))):
        for z in range(1, int(math.sqrt(N))):
            ans = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if (ans > N):
                break
            else:
                A[ans] += 1


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

Solution (Python):
n=int(input())
k=int(n**0.5)+1
num=[0 for i in range(n+1)]
for x in range(1,k):
  for y in range(1,k):
    for z in range(1,k): 
      w=x**2+y**2+z**2+x*y+y*z+z*x
      if w<=n:
        num[w]+=1
for i in range(1,n+1):
  print(num[i])

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

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

Solution (Python):
from collections import Counter
a_list = list(range(1,10**4+1))
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      a_list.append(i**2+j**2+k**2+i*j+j*k+k*i)
count = Counter(a_list)
N=int(input())
for i in range(N):
  print(count[i+1]-1)

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

flist = [0]*(10**4+10)


def cal(i, j, k):
    return i ** 2+j ** 2 + k ** 2+i*j+j*k+k*i


for i in range(1, 101):
    for j in range(i, 101):
        for k in range(j, 101):
            s = cal(i, j, k)
            if s >= 10**4+5:
                break
            if i == j and j == k:
                flist[s] += 1
            elif i == j:
                flist[s] += 3
            elif j == k:
                flist[s] += 3
            else:
                flist[s] += 6
for i in range(1, n+1):
    print(flist[i])

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

c = {}
def f(x,y,z):
    return x**2+y**2+z**2+(x*y)+(y*z)+(z*x)

for i in range(1,n+1):
    t3 = f(i,1,1)
    if t3>n:
        break
    for j in range(i,n+1):
        t2 = f(i,j,1)
        if (t2>n):
            break
        for k in range(j,n+1):
            t = f(i,j,k)
            if t>n:
                break
            else:
                if t not in c:
                    c[t]=0
                if i==j and j==k:
                    c[t]+=1
                elif i==j or j==k or i==k:
                    c[t]+=3
                else:
                    c[t]+=6
for i in range(1,n+1):
    if i not in c:
        print(0)
    else:
        print(c[i])

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue
import numpy as np

Mod = 1000000007
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1] 
for i in range(2, 10**5 + 1):
    fact.append((fact[-1] * i) % Mod)
    inv.append((-inv[Mod % i] * (Mod // i)) % Mod)
    factinv.append((factinv[-1] * inv[-1]) % Mod)
    
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p
    
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[y] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)
import string
def main():  
    n = int(input())
    ans = [0 for i in range(n)]
    for i in range(1, int(np.sqrt(n + 1))):
        for j in range(1, int(np.sqrt(n + 1))):
            for k in range(1,int(np.sqrt(n + 1))):
                x = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if x <= n:
                    ans[x - 1] += 1
    for i in range(n):
        print(ans[i])
if __name__ == "__main__":
    main()

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

ans=[0]*(n+1)

def func():
    cnt=0
    for x in range(1,101):
        for y in range(x,101):
            for z in range(y,101):
                p=x**2+y**2+z**2+x*y+y*z+z*x
                if p<n+1:
                    if x==y and y==z:
                        ans[p]+=1
                    elif x==y or y==z:
                        ans[p]+=3
                    else:
                        ans[p]+=6
func()

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

Solution (Python):
def main():
    n = int(input())
    cnt = [0] * 10001

    for i in range(1,100):
        for j in range(1,100):
            for k in range(1,100):
                v = i*i + j*j + k*k + i*j + j*k + k*i
                if v<=10000:
                    cnt[v] += 1

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

main()

Solution (Python):


def solve(*args: str) -> str:
    n = int(args[0])

    n_sqrt = -int(-pow(n, 0.5))
    A = [0]*(n+1)

    for x in range(1, n_sqrt):
        for y in range(1, n_sqrt):
            for z in range(1, n_sqrt):
                i = x*x+y*y+z*z+x*y+y*z+z*x
                if i <= n:
                    A[i] += 1

    return '\n'.join(map(str, A[1:]))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
n = int(input())
h = [0 for _ in range(n)]

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

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

Solution (Python):
N = int(input())
lis = [0] * 1001001
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
            lis[n] += 1
for i in range(1, N+1):
    print(lis[i])

Solution (Python):
n=int(input())
from itertools import combinations_with_replacement,product
li = list(product(range(1,101),repeat=3))
ans = [0]*10001

for k in li:
    if k[0]**2 + k[1]**2 + k[2]**2 + k[0]*k[1] + k[0]*k[2]+k[1]*k[2] < 10001:
        ans[k[0]**2 + k[1]**2 + k[2]**2 + k[0]*k[1] + k[0]*k[2]+k[1]*k[2]] += 1

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
ans=[0]*10**6
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):
            tmp=i**2+j**2+k**2+i*j+j*k+k*i
            ans[tmp]+=1
for i in range(1,N+1):
    print(ans[i])

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

l = [0] * (n)

for i in range(1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      t = (i ** 2) + (j ** 2) + (k ** 2) + (i * j) + (j * k) + (i * k)
      if t > n:
        break
      l[t-1] += 1
for i in range(n):
  print(l[i])

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

MAX = 100
from collections import defaultdict
d = defaultdict(int)
from itertools import product
for x, y, z in product(range(1, 1+MAX), repeat=3):
  t = x*x + y*y + z*z + x*y + y*z + z*x
  d[t] += 1

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

Solution (Python):
import math
n = int(input())
l =[0 for i in range(6*n+1)]

for i in range(1,int(math.sqrt(n))):
    for j in range(1,int(math.sqrt(n))):
        for q in range(1,int(math.sqrt(n))):
            
            l[i**2+j**2+q**2 +i*j +i*q+q*j]+=1
for i in range(1,n+1):
    print(l[i])

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

ans=[0]*(n+100000)

import math
for x in range(1,int(math.sqrt(n+1)+1)):
    if x**2 > n:
        break
    for y in range(1,int(math.sqrt(n+1)+1)):
        if x**2 +y**2 + x*y> n:
            break
        for z in range(1,int(math.sqrt(n+1)+1)):
            calc = x**2+y**2+z**2+x*y+y*z+z*x
            ans[calc]+=1

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

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

def func(x,y,z):
  return x*x+y*y+z*z+x*y+y*z+z*x

for i in range(1,N+1):
  answer_set=set()
  for x in range(int(i**0.5)+1):
    for y in range(1,x+1):      
      for z in range(1,y+1):
        if func(x,y,z)==i:
          answer_set.add((x,y,z))
          answer_set.add((x,z,y))
          answer_set.add((y,x,z))
          answer_set.add((y,z,x))
          answer_set.add((z,y,x))
          answer_set.add((z,x,y))
        elif func(x,y,z)>i:
          break
          
  print(len(answer_set))

Solution (Python):
N = int(input())
M = int(N**(1/2))+2

A = [0 for _ in range(N+1)]
for x in range(1, M):
    for y in range(1, M):
        for z in range(1, M):
            f = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if f <= N:
                A[f] += 1
for a in A[1:]:
    print(a)

Solution (Python):
N = int(input())
cap = 100
table = [0] * 10001

for x in range(1, cap):
    for y in range(1, cap):
        for z in range(1, cap):
            idx = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if idx <= 10000:
                table[idx] += 1

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

Solution (Python):
from math import sqrt
n = int(input())
X = [0] * (n+1)
for x in range(1, int(sqrt(n)) + 1):
    for y in range(1, int(sqrt(n)) + 1):
        if x**2 + y**2 + x*y + 3 > n:
            break
        t = x**2 + y**2 + x*y
        for z in range(1, int(sqrt(n)) + 1):
            s = t + z**2 + y*z + z*x
            if s <= n:
                X[s] += 1
            else:
                break
print(*X[1:], sep='\n')

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

MAX = 10 ** 4 + 5


def main(input, print):
    N = int(input())
    ans = [0] * MAX
    for x in range(1, 99):
        for y in range(1, 99):
            for z in range(1, 99):
                a = x**2+y**2+z**2+x*y+y*z+z*x
                if a < MAX:
                    ans[a] += 1
    for i in range(1, N+1):
        print(ans[i])


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

n = int(input())










import math

ans = [0]*(n+1)
upper = math.ceil(math.sqrt(n))

for x in range(1,upper+1):
    for y in range(1,upper+1):
        for z in range(1,upper+1):
            tmp = pow((x+y),2)+pow((y+z),2)+pow((x+z),2)
            if tmp%2 == 0 and tmp//2 <= n:
                ans[tmp//2] += 1
                
print(*ans[1:])

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

limit = 1
while limit * limit < n:
    limit += 1

results = [0] * n

for x in range(1, limit + 1):
    for y in range(1, limit + 1):
        for z in range(1, limit + 1):
            val = x * x + y * y + z * z + x * y + y * z + x * z
            if val <= n:
                results[val - 1] += 1

for v in results:
    print(v)

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

ans = [0] * (10 ** 5 + 1)
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 + z * x] += 1

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

Solution (Python):
import math

n = int(input())
th = int(math.sqrt(n))
ans = [0 for _ in range(n)]
for x in range(1,th+1):
  for y in range(1,th+1):
    for z in range(1,th+1):
      tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if tmp <= n:
        ans[tmp-1] += 1
for i in ans:
  print(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):
            ni = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if ni <= n:
                ans[ni] += 1
for i in range(1, n+1):
    print(ans[i])

Solution (Python):
from collections import defaultdict

N = int(input())
ctr = defaultdict(int)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ctr[res] += 1

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

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

Solution (Python):
from collections import defaultdict

N = int(input())
ans = defaultdict(int)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            t = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if t > 10**4:
                break
            ans[t] += 1

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

Solution (Python):
import math
from collections import defaultdict

N = int(input())
D = defaultdict(int)

NN = math.floor(math.sqrt(N))
for x in range(1,NN+1):
    for y in range(1,NN+1):
        for z in range(1,NN+1):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if a <= N:
                D[a] += 1

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

Solution (Python):
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)

Solution (Python):
N = int(input())
ans = [0 for _ in range(N + 100)]
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            cnt = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + i * k
            if cnt <= N:
                ans[cnt - 1] += 1
for i in range(N):
    print(ans[i])

Solution (Python):
n = int(input())
x = int(n**0.5)+1
cnt = [0]*(n+1)
for i in range(1,x):
    for j in range(1,x):
        for k in range(1,x):
            res = i**2+j**2+k**2+i*j+j*k+k*i
            if res <= n: cnt[res] += 1
for i in range(1,n+1): print(cnt[i])

Solution (Python):
def func_n(x,y,z):
    return ((x+y+z)**2+x**2+y**2+z**2)//2
N=int(input())
box=[0]*N
for x in range(1,100):
    for y in range(1,99):
        for z in range(1,99):
            a=func_n(x,y,z)
            if a>N:
                break
            box[a-1]+=1
for i in range(N):
    print(box[i])

Solution (Python):
import sys

sys.setrecursionlimit(1000000)


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

def p_solve(N):
    ans = [0 for _ in range(N)]
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                k = f(x, y, z)
                k -= 1
                if 0 <= k < len(ans):
                    ans[k] += 1
    return ans

def solve(N):
    ans = p_solve(N)
    for a in ans:
        print(a)

if __name__ == "__main__":
    N = int(input())
    solve(N)

Solution (Python):
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      if i*i+j*j+k*k+i*j+k*j+k*i<=n:
        li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])

Solution (Python):
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq

import bisect
import sys

sys.setrecursionlimit(10**6)


def bfs(s, n, node):
    
    check = [False for _ in range(n)]
    check[s] = True
    
    queue = deque([s])
    visited_num = 1

    
    
    color = [-1 for _ in range(n)]
    color[s] = 0

    while visited_num < n:
        
        if len(queue) == 0:
            
            
            return color

        now_vertex = queue.popleft()
        
        for next_vertex in node[now_vertex]:

            if check[next_vertex] == True:
                continue

            queue.append(next_vertex)
            check[next_vertex] = True

            
            color[next_vertex] = color[now_vertex]+1
            visited_num += 1

    return color


mod = 10**9+7



def ceil(x, y): return (x+y-1)//y
def input_list(): return list(map(int, input().split()))


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


n = int(input())
ans = [0 for _ in range(n)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            tmp = cal(x, y, z)
            if tmp <= n:
                ans[tmp-1] += 1

for i in ans:
    print(i)

Solution (Python):
n = int(input())
a = [0]*((10**4)+1)
for i in range(1,101):
    for j in range(1,101):
        for  k in range(1,101):
            try:
                a[i*i+j*j+k*k+i*j+j*k+i*k]+=1
            except:
                continue
for i in range(1, n+1):
    print(a[i])

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

ans = [0] * (10**5)

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

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

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

ans = [0]*(10**7)
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
      ans[tmp] += 1
  
for i in range(1,n+1):
  print(ans[i])

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

N = int(input())

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


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


for i in range(1, 150):
    for j in range(1, 150):
        for k in range(1, 150):
            tmp = calc(i, j, k)
            if tmp <= 10 ** 4:
                ans[tmp] += 1


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

Solution (Python):
from collections import Counter
N = int(input())

counter = Counter()
until = int((N**0.5)+1)

for x in range(1, until):
    for y in range(1, until):
        for z in range(1, until):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            counter[tmp] += 1
for i in range(1, N+1):
    print(counter[i])

Solution (Python):
import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict






def solve(x):  
    console("----- solving ------")

    res = defaultdict(set)
    for a in range(1, int(math.sqrt(x))):
        for b in range(1, int(math.sqrt(x - a*a))):
            for c in range(1, int(math.sqrt(x - a*a - b*b))):
                total = a**2 + b**2 + c**2 + a*b + b*c + a*c
                res[total].add(tuple(sorted([a,b,c])))

    for i in range(1,x+1):
        console(i, res[i])
        cnt = 0
        for a,b,c in res[i]:
            if a == b == c:
                cnt += 1
            elif a == b:
                cnt += 3
            elif b == c:
                cnt += 3
            else:
                cnt += 6
        print(cnt)
    return None


def console(*args):  
    
    return



    
    

    
k = int(input())
    
    
    

    
    

    
    
    
    
    
    

solve(k)

Solution (Python):
def solve(n):
    li = [0] * (n ** 3 + 1)
    for x in range(1, n + 1):
        for y in range(1, n + 1):
            for z in range(1, n + 1):
                li[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1
    return li


N = int(input())
ans = solve(100)
[print(ans[i]) for i in range(1, N + 1)]

Solution (Python):
N = int(input())
N_list = [0]*(N+1)

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list[1:]:
    print(i)

Solution (Python):
ans= [0]*(6*10**4+10)
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
n = int(input())
for i in range(1,n+1):
    print(ans[i])

Solution (Python):
n=int(input())
x,y,z=1,1,1
ans=[0]*(n+1)
while x>0:
    while y>0:
        while z>0:
            num=x*x+y*y+z*z+x*y+y*z+z*x
            if num>n:
                z=1
                break
            ans[num]+=1
            z+=1
        if x*x+y*y+1+x*y+y+x>n:
            y=1
            break
        y+=1
    if x*x+2+x+x+1>n:
        break
    x+=1
for i in range(1,n+1):
    print(ans[i])

Solution (Python):
import collections
n = int(raw_input())
h = collections.Counter()
for x in range(1,n+1):
	if x ** 2 > n:
		break
	for y in range(1,n+1):
		if x ** 2 + y ** 2 + x * y > n:
			break
		for z in range(1,n+1):
			q = x ** 2 + y ** 2 + z ** 2
			q += x*y + y*z + z * x
			if q > n:
				break
			h[q] +=1 
for i in range(1,n+1):
	print h[i]

Solution (Python):
n = int(input())
l = [0] * (10**5)
N = 10**4

for i in range(1, 10**2+1):
    for j in range(1, 10**2+1):
        for k in range(1, 10**2+1):
            a = i*i + j*j + k*k + i*j + j*k + k*i
            l[a] += 1

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

Solution (Python):
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n = int(input())
    ans = [0]*(n+1)
    lim = int(n**(0.5)) +1
    for i in range(1, lim):
        for j in range(1,lim):
            for k in range(1,lim): 
                tmp = i**2 + j**2 + k**2 +i*j + j*k+ k*i
                if tmp <= n:
                    ans[tmp] += 1
    for a in ans[1:]:
        print(a)   


if __name__ == '__main__':
    main()

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

results = [0]*N


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


for x in range(1, int(math.sqrt(N))):
    for y in range(1, int(math.sqrt(N))):
        for z in range(1, int(math.sqrt(N))):
            result = calc(x, y, z) - 1
            if result >= N:
                continue
            else:
                results[result] += 1

for result in results:
    print(result)

Solution (Python):
N = int(input())
ans = [0]*N
n = int(N**0.5 + 1)
for x in range(1, n+1):
    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 + x*z
            if a <= N:
                ans[a-1] += 1
for i in range(N):
    print(ans[i])

Solution (Python):
n=int(input())+1
table0=[0]*10001
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      r=x*x+y*y+z*z+x*y+y*z+x*z
      if r<n:
        table0[r]+=1
for i in range(1,n):
  print(table0[i])

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


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

    anses = [0] * N

    for x in range(1, N):
        for y in range(x, N):
            for z in range(y, N):
                a = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if a > N:
                    break
                if x == y == z:
                    anses[a - 1] += 1
                elif x == y or y == z or z == x:
                    anses[a - 1] += 3
                else:
                    anses[a - 1] += 6
    
    for a in anses:
        print(a)

solve()

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

Solution (Python):
from collections import defaultdict

N = int(input())


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

res = defaultdict(int)

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      res[fun(x, y, z)] += 1
        
for n in range(1, N+1):
  print(res[n])

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

d=[0]*(2*10**6+1)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      d[i**2+j**2+k**2+i*j+i*k+j*k]+=1
for i in range(1,n+1):
  print(d[i])

Solution (Python):
n = int(input())
l = [0]*10010


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

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

Solution (Python):
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())

d = [0]*(10**6 + 1)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            d[res] += 1

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

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

m = int(N**0.5) + 2
l = [0]*(N+1)

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

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

Solution (Python):
n = int(input())
ans_dic = dict.fromkeys([i for i in range(1, 10**5)], 0)
for i in range(1, 10**2 + 1):
    for j in range(1, 10**2 + 1):
        for k in range(1, 10**2 + 1):
            tryvalue = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if tryvalue <= 10**4 + 3:
                ans_dic[tryvalue] += 1
for l in range(1, n + 1):
    print(ans_dic[l])

Solution (Python):
def main():
    N = int(input())
    L = [0]*(N+1)
    for i in range(1,120):
        for j in range(1,120):
            for k in range(1,120):
                temp =  i**2 + j**2 + k**2 + i*j + j*k + k*i
                if N >= temp:
                    L[temp] += 1
                else:
                    break


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



if __name__ == '__main__':
    main()

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