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):
import math
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
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 S(): return input()
def LS(): return input().split()


INF = float('inf')


def f(m):
    res = 0
    r_m = math.sqrt(m)
    for i in range(1, int(r_m) + 1):
        for j in range(1, int(r_m) + 1):
            for k in range(1, int(r_m) + 1):
                if i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i == m:
                    print(f'{(m, i, j, k)=}')
                    res += 1
    return res


n = I()
cnt = [0] * 10001
r_n = int(math.sqrt(n)) + 1
for x in range(1, r_n):
    for y in range(1, r_n):
        for z in range(1, r_n):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v <= n:
                cnt[v] += 1

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

Solution (Python):



def main():
    N = int(input())
    ans = [0] * N
    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 - 1
                if t >= len(ans):
                    break
                ans[t] += 1

    print(*ans)


if __name__ == "__main__":
    main()

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

Solution (Python):


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

Solution (Python):
import math
n=int(input())
z=0
d=0
ans=0
for i in range(1,n+1):
  for x in range(1,int(math.sqrt(n)+1)):
    for y in range(1,int(math.sqrt(n)+1)):
      d=x*x+y*y+2*x*y-4*(x*x+y*y+x*y-i)
      if d<0:
        continue
      z=(math.sqrt(d)-(x+y))/2
      if z.is_integer() and z>=1:
        ans+=1
      else:
        continue
  print(ans)
  ans=0

Solution (Python):
import itertools
import math
import collections
def main():
    n = int(input())
    s = int(math.sqrt(n))
    a = list(itertools.product(range(1,s),repeat=3))
    ans = []
    for i in range(len(a)):
        t = a[i][0] ** 2 + a[i][1] ** 2 + a[i][2] ** 2 + a[i][0] * a[i][1] + a[i][1] * a[i][2] + a[i][2] * a[i][0]
        ans.append(t)
        
    c = collections.Counter(ans)
    for i in range(1,n+1):
        print(c[i])
        
        
main()

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

fn = [0] * (N+1)
for x in range(1,101):
    for y in range(1,101):
        if x**2 + y**2 + x*y >= N:
            break
        for z in range(1,101):
            val = x**2 + y**2 + z**2 + x*y+y*z+z*x
            if val > N:
                break
            fn[val] += 1

for v in fn[1:]:
    print(v)

Solution (Python):
import math

def main():
    N = int(input())
    ans = [0]*(N+1)

    rn = math.ceil(math.sqrt(N))

    for x in range(1,rn):
        for y in range(1,rn):
            for z in range(1,rn):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= N:
                    ans[k-1] += 1
    
    for i in range(len(ans) - 1):
        print(ans[i])
    
main()

Solution (Python):
N = int(input())
ans = [0] * 100000
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            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):
import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

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

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


x = 1
y = 1
z = 1

ans = 6
first_judge = 1
ans_out = 0


if N <= 5:
    for i in range(N):
        print(l[i])
else:
    while ans <= N:
        
        ans = (x + y + z)**2 - (x*y+ y*z + z*x)
        
        if first_judge == 1 and ans > N:
            if ans_out >= 2:
                
                break
            else:
                x += 1
                y = x
                z = x
                ans_out += 1
                first_judge = 1
                ans = 0
                
                
                
        elif ans <= N:
            ans_out = 0
            if x==y==z:
                
                
                l[ans-1] += 1
                first_judge = 0
            elif x==y or y==z or z==x:
                
                
                l[ans-1] += 3
                first_judge = 0
            else:
                l[ans-1] += 6
                first_judge = 0
            z += 1
        else:
            y += 1
            z = y
            first_judge = 1
            ans_out += 1
            ans = 0
            
            
            
            
        
        
    for i in range(N):
        print(l[i])

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

lis = [0] * (n+1)


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

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

Solution (Python):
n=int(input())
N=10**4+1
lst=[0]*N
s=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):
            s=i**2+j**2+k**2+i*j+j*k+k*i
            if s<10**4+1:
                lst[s]+=1
for i in range(1,n+1):
    print(lst[i])

Solution (Python):
import numpy as np









N = int(input())





num=np.zeros(10**4+1)
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
            if ans < 10**4+1:
                num[ans]+=1


for i in range(N):
    print(int(num[i+1]))

Solution (Python):
n = int(input())
c = [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
            if n >= N:
                c[N-1] += 1
for i in c:
    print(i)

Solution (Python):
import collections

ans_list = []

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 <= 10000:
                ans_list.append(tmp)

ans_list = sorted(ans_list)

N = int(input())

c = collections.Counter(ans_list)

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

Solution (Python):
import itertools
import math
 
a = int(input())
cnt = 0
ans = [0]*100000
l = list(range(1,int(math.sqrt(a))))
 
for x,y,z in itertools.product(l, repeat=3):
    ans[x*x+y*y+z*z+x*y+y*z+z*x]+=1

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

Solution (Python):
N = int(input())
ls = [0]*(N+2)
 
for i in range(1,151):
    for j in range(1,151):
        for k in range(1,151):
            t = i*i + j*j + k*k + i*j + j*k + k*i 
            if t <= N :
                ls[t] += 1
 
for p in range(1,N+1):
    print(ls[p])

Solution (Python):
n = int(input())
A = [0]*10**7

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            A[x**2+y**2+z**2+x*y+y*z+z*x] += 1
                
print(*A[1:n+1],sep='\n')

Solution (Python):
N = int(input())
ls = [0]*(N+2)

for i in range(1,151):
    for j in range(1,151):
        for k in range(1,151):
            t = i*i + j*j + k*k + i*j + j*k + k*i 
            if t <= N :
                ls[t] += 1

for p in range(1,N+1):
    print(ls[p])

Solution (Python):
n = int(input())
ans = [0]*(6*10**4)
for x in range(1, 10**2+1):
    for y in range(x, 10**2+1):
        for z in range(y, 10**2+1):
            cal = x*x + y*y + z*z + x*y + y*z + z*x
            if x == y and y == z:
                ans[cal-1] += 1
            elif x == y or y == z:
                ans[cal-1] += 3
            else:
                ans[cal-1] += 6
for i in range(n):
    print(ans[i])

Solution (Python):
import math
n = int(input())
count = [0]*(10**7)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            count[i*i + j*j + k*k + i*j + j*k + k*i -1] += 1
for i in range(n):
    print(count[i])

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

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

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

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


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


N = int(input())

ans = [0 for _ in range(N)]
lim = 101
for x in range(1, lim):
    for y in range(1, lim):
        for z in range(1, lim):
            A = f(x, y, z)
            if A <= N:
                ans[A-1] += 1
for i in range(N):
    print(ans[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):
            a = x * x + y * y + z * z + x * y + x * z + y * z
            if a > n: continue
            ans[a-1] += 1
for i in ans: print(i)

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

n=int(input())
ans = [0]*int(1e5+1)
for x in range(1,10**2+1):
    for y in range(1,10**2+1):
        for z in range(1,10**2+1):
            ans[x*x + y*y + z*z + x*y + y*z + z*x]+=1
print(*ans[1:n+1])

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

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



def checker():
    ans = [0] * 10001
    for a in range(1, 101):
        for b in range(1, 101):
            for c in range(1, 101):
                n = a * a + b * b + c * c + a * b + b * c + c * a
                if n > 10000:
                    continue
                else:
                    ans[n] += 1
    return ans


def main():
    N = int(input().strip())
    ans = checker()
    for n in range(1, N + 1):
        print(ans[n])
    return


if __name__ == "__main__":
    main()

Solution (Python):
import math
n=int(input())
dp=[0]*(n+2)
sq=int(math.sqrt(n))
for x in range(1,sq+1):
    for y in range(1,sq+1):
        for z in range(1,sq+1):
            aa=(x*x+y*y+z*z+x*y+y*z+z*x)
            if aa<=n:
                dp[aa]+=1
for i in range(1,n+1):
    print(dp[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):
            f= x**2 + y**2 + z**2 + x*y + y*z + z*x
            if f<=n:
                ans[f]+=1

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

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

counter = [0] * 10001
for x in range(1, 100+1):
    n1 = x * x
    if n1 >= N:
        continue
    for y in range(x, 100+1):
        n2 = n1 + y * y + x * y
        if n2 >= N:
            continue
        for z in range(y, 100+1):
            n = n2 + z * z + y * z + z * x
            if 1 <= n <= 10000:
                if x == y and y == z:
                    counter[n] += 1
                elif x == y or y == z:
                    counter[n] += 3
                else:
                    counter[n] += 6
for i in range(1, N+1):
    print(counter[i])

Solution (Python):
n=int(input())
l=[0]*(10**5)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            l[(x*x+y*y+z*z+x*y+y*z+z*x)-1]+=1
for i in range(n):
    print(l[i])

Solution (Python):
N = int(input())
ans = [0 for _ in range(N+1)]
for x in range(1,101):
  for y in range(x, 101):
    for z in range(y , 101):
      f = x**2 + y**2 + z**2 +x*y + y*z + z*x
      if f > N:
        break
      if x==0 or y==0 or z==0:
        continue
      if x==y and y==z:
        
        ans[f] += 1
      elif x==y or y==z or z==x:
        
        ans[f] += 3
      else:
        
        ans[f] += 6
for a in ans[1:]:
  print(a)

Solution (Python):


LI = lambda: list(map(int, input().split()))


N = int(input())

MAX = 10 ** 2


def main():
    l = [0] * (N + 1)
    for x in range(1, MAX + 1):
        for y in range(1, MAX + 1):
            for z in range(1, MAX + 1):
                v = (x + y + z) ** 2 - (x * y + y * z + z * x)
                if v <= N:
                    l[v] += 1
    for ans in l[1:]:
        print(ans)
        

if __name__ == "__main__":
    main()

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False


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

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

    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):
                ans[f(x, y, z)] += 1

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

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
num = [0]*10000

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x - 1
            if a <= 9999:
                num[a] += 1

num = num[:n]

for i in num:
    print(i)

Solution (Python):
import itertools
import math

a = int(input())
cnt = 0
ans = [0]*100000
l = list(range(1,int(math.sqrt(a))))

for x,y,z in itertools.product(l, repeat=3):
	ans[x*x+y*y+z*z+x*y+y*z+z*x]+=1

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

Solution (Python):
n = int(input())
list_ = [0]*1000000
for i in range(1,100):
   for j in range(1,100):
       for k in range(1,100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[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):
            if x**2+y**2+z**2+x*y+y*z+z*x <= n:
                ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
for i in range(n):
    print(ans[i])

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


N = int(input())
count = [0] * (N + 1)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            cur = g(x, y, z)
            if cur <= N:
                count[cur] += 1
for i in range(1, N + 1):
    print(count[i])

Solution (Python):
n = int(input())
fn = [0] * (n+1)
def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x 

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            idx = f(x, y, z)
            if idx <= n:
                fn[idx] += 1
for i in range(1, n+1):
    print(fn[i])

Solution (Python):
n = int(input())
cnt = [0] * (1 + n)
for a in range(1, 100):
    for b in range(1, 100):
        for c in range(1, 100):
            k = a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a
            if k > n:
                continue
            else:
                cnt[k] += 1
for i in range(1, n + 1):
    print(cnt[i])

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

def main():
	N = inputInt()

	ans = [0 for i in range(N)]
	for x in range(1,100+1):
		for y in range(1,100+1):
			for z in range(1,100+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)
		
if __name__ == "__main__":
	main()

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

Solution (Python):
N = int(input())
answer = [0] * (10001)

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            index = x * x + y * y + z * z + x * y + y * z + z * x - 1
            if index > N:
                break
            answer[index] += 1
            

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

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

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

Solution (Python):
n=int(input())
r=range(1,int(2*n**.5)+1)
l=[0]*-~n
for i in r:
  for j in r:
    for k in r:
      t=(j+k)**2+(k+i)**2+(i+j)**2
      if t<=n*2 and t%2<1: l[t//2]+=1
for i in range(n): print(l[i+1])

Solution (Python):
n=int(input())
dp=[0]*(n+2)
for x in range(1,151):
    for y in range(1,151):
        for z in range(1,151):
            aa=(x*x+y*y+z*z+x*y+y*z+z*x)
            if aa<=n:
                dp[aa]+=1
for i in range(1,n+1):
    print(dp[i])

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

Solution (Python):
import numpy as np


def calc(n):

    lim = 130

    result = np.zeros(n + 1, dtype=int)
    for x in range(1, lim):
        for y in range(x, lim):
            for z in range(y, lim):
                index = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if index > n:
                    continue
                s = set([x, y, z])
                if len(s) == 1:
                    result[index] += 1
                elif len(s) == 2:
                    result[index] += 3
                else:
                    result[index] += 6

    return result[1:]


for i in calc(int(input())):
    print(i)

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

Solution (Python):


N = int(input())

Ret = [0 for _ in range(10**5)]

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            r = i**2 + j**2 + k**2 + i*j + j*k + i*k
            Ret[r] += 1

for r in Ret[1:N+1]:
    print(r)

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):
            val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if val <= n:
                ans[val] += 1

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

Solution (Python):
import math
N = int(input())
fn = {i+1:0 for i in range(N)}
rtN = int(math.sqrt(N))+1

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

for x in range(1, rtN):
    for y in range(1, rtN):
        for z in range(1, rtN):
            n_ = n(x,y,z)
            try:
                fn[n_] += 1
            except KeyError:
                pass

for k in fn.values():
    print(k)

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

import collections

count = collections.defaultdict(int)


for x in range(1, 10000):
    for y in range(1, 10000):
        if x*x + y*y + 1 + x*y + y + x > 10000:
            break
        for z in range(1, 100000):
            n = x*x + y*y + z*z + x*y + y*z + z*x
            if n > 10000:
                break
            else:
                count[n] += 1


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

Solution (Python):
import numpy as np


def calc(n):
    
    lim = 130

    result = np.zeros(n + 1, dtype=int)
    for x in range(1, lim):
        for y in range(1, lim):
            if x > y:
                continue
            for z in range(1, lim):
                if y > z:
                    continue
                index = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if index > n:
                    continue
                s = set([x, y, z])
                if len(s) == 1:
                    result[index] += 1
                elif len(s) == 2:
                    result[index] += 3
                else:
                    result[index] += 6

    return result[1:]


for i in calc(int(input())):
    print(i)

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

Solution (Python):

n = int(input())
cnt = [0] * (1 + n)
for a in range(1, 100):
    for b in range(1, 100):
        for c in range(1, 100):
            k = a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a
            if k > n:
                continue
            else:
                cnt[k] += 1
for i in range(1, n + 1):
    print(cnt[i])

Solution (Python):
import math

n=int(input())

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


ans=[0]*(n+1)

limit=math.ceil(n**0.5)
for x in range(1,limit+1):
    for y in range(1,limit+1):
        for z in range(1,limit+1):
            temp=culc(x,y,z)
            if temp<=n:
                ans[temp]+=1

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

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

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

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

Solution (Python):

def binary_search(mn,mx,a,x,y):
    
    
    z = (mx+1)//2
    low = mn
    high = mx+1
    while low <= high:
        temp = rule2(x,y,z)
        if temp == a:
            if z <= 0:
                return None
            return z
        elif temp < a:
            low = z + 1
        elif temp > a:
            high = z - 1

        z = (low + high) // 2
    return None

def rule2(x,y,z):
    return x ** 2 + y ** 2 + z**2 + x * y + y * z + z*x
def main():
    n = int(input())
    x = []
    y = []
    for i in range(1,n+1):
        
        
        print(f(i))
    
    


def f(n):
    counter = 0
    for x in range(1,n):
        if x ** 2 > n:
            break
        for y in range(x,n-x**2):
            if y < x:
                continue
            if x ** 2 + y ** 2 > n:
                break
            z = binary_search(y,n-x**2-y**2-x*y,n,x,y)
            if z == None:
                continue
            else:
                if rule2(x,y,z) == n:
                    if x == y and y == z and z == x:
                        counter += 1
                    elif x != y and y != z and z != x:
                        counter += 6
                    else:
                        counter += 3

    return counter


if __name__ == '__main__':
    main()

Solution (Python):
import itertools
N = int(input())
rng = int(-(-N**0.5//1))
pat_list = list(itertools.product(range(1,rng),repeat=3))
cnt_list = [0 for i in range(rng**2*6)]
for X, Y, Z in pat_list:
    cnt_list[X**2+Y**2+Z**2+X*Y+Y*Z+Z*X] += 1

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

Solution (Python):


def main():
    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):
                f = x * x + y * y + z * z + x * y + y * z + z * x
                if f < N + 1:
                    ans[f] += 1
    ans.remove(0)
    print('\n'.join(map(str, ans)))


if __name__ == "__main__":
    main()

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

l = [0]*N
for i in range(int(N**(1/2))):
    for j in range(int(N**(1/2))):
        for k in range(int(N**(1/2))):
            a = (i+1)**2 + (j+1)**2 + (k+1)**2 + (i+1)*(j+1) + (j+1)*(k+1) + (k+1)*(i+1)
            if a > N:
                break
            l[a-1] = l[a-1] + 1

for c in range(N):
    print(l[c])

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

ans=[0]*N

for i in range(1,int(N**0.5)):
    if i**2 >=N:
        break
    for j in range(1,int(N**0.5)):
            if i**2+j**2+i*j>=N:
                break
            for k in range(1,int(N**0.5)):
                    if i**2+j**2+k**2+i*j+j*k+k*i <=N:
                        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):
from collections import defaultdict
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())

    ans = defaultdict(int)
    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 + y * z + z * x
                ans[n] += 1

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


main()

Solution (Python):
from math import sqrt

n = int(input())
lim_n = int(sqrt(n*2))
result = [0] * n

for i in range(2, lim_n+1):
    for j in range(2, i+1):
        for k in range(2, j+1):
            p = i**2+j**2+k**2
            if p > 2*n:
                break
            if p % 2 == 1:
                continue
            if (j + k) - i < 2:
                continue
            if i == j and j == k:
                if i  % 2 ==1:
                    continue
                result[p//2-1] += 1
            elif i != j and j != k:
                result[p//2-1] += 6
            else:
                result[p//2-1] += 3

for item in result:
    print(item)

Solution (Python):
n=int(input())
lst=[0]*10000000
for i in range(1, 101):
  for j in range(1, i+1):
    for k in range(1, j+1):
      temp=i**2+j**2+k**2+i*j+j*k+k*i
      if i==j and j==k:
        lst[temp+1]+=1
      elif i==j and j!=k:
         lst[temp+1]+=3
      elif j==k and k!=i:
         lst[temp+1]+=3
      elif k==i and i!=j:
         lst[temp+1]+=3
      elif i!=j and j!=k and k!=i:
         lst[temp+1]+=6
for p in range(1, n+1):
  print(lst[p+1])

Solution (Python):


import math

n = int(input())

result = [0] * (n + 1)
border = 0
if n>=3:
    border = int(math.sqrt(n - 2))
for x in range(1, border):
    for y in range(1, border):
        for z in range(1, border):
            r = ((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2) // 2
            if r > n:
                break
            else:
                result[r] += 1

for num in result[1::]:
    print(num)

Solution (Python):
N=int(input())
import math
ans=[0]*(N+1)
n=int(math.sqrt(N))+1
for i in range(1,n+1):
    if i*i +2*i >N:
        break
    for j in range(1,n+1):
        if i*i+j*j+i*j>N:
            break
        for k in range(1,n+1):
            if i*i+j*j+k*k+i*j+j*k+i*k>N:
                break
            else:
                
                ans[i*i+j*j+k*k+i*j+j*k+i*k]+=1
for i in range(len(ans)):
    if i!= 0:
        print(ans[i])

Solution (Python):
N = int(input())
L=[0]*N
for x in range(1,200):
    for y in range(x,200):
        for z in range(y,200):
            f=x**2+y**2+z**2+x*y+y*z+z*x
            if f<=N:
                
                if x==y==z:
                    L[f-1]+=1
                    
                elif x!=y and y!=z and y!=z:
                    L[f-1]+=6
                else:
                    L[f-1]+=3
                    
for i in range(N):
    print(L[i])

Solution (Python):
a = int(input())
b = round(a**0.5) + 1
x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]-1] = t[x[i]-1] + 1

for i in t:
    print(i)