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.



Sample input:
20


Sample output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

Submission status: Accepted

Solution code:
n=int(input())
ans=[0 for _ in range(100050)]
for i in range(1,105):
  for j in range(1,105):
      for k in range(1,105):
        v=i*i+j*j+k*k+i*j+j*k+k*i
        if v<10050:
          ans[v]+=1

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

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
ans = [0 for i in range(n)]

tmp=0
for i in range(1,math.ceil(math.sqrt(n))):
    for j in range(1,math.ceil(math.sqrt(n))):
        for k in range(1,math.ceil(math.sqrt(n))):
            tmp = i**2+j**2+k**2+i*j+j*k+k*i
            if tmp <=n:
                ans[tmp-1]+=1

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

Submission status: Accepted

Solution code:

def solve():
    N = int(input())
    A = [0] * (N + 1)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                s = x * x + y * y + z * z + x * y + x * z + y * z
                if s <= N:
                    A[s] += 1
    for i in range(1, N + 1):
        print(A[i])

solve()

Submission status: Accepted

Solution code:
from sys import stdin,stdout                           #
import math                                            #
import heapq                                           #
                                                       #
t = 1                                                  #
def aint():                                            #
	return int(input().strip())                        #
def lint():                                            #
	return list(map(int,input().split()))              #
def fint():                                            #
	return list(map(int,stdin.readline().split()))     #
                                                       #	
########################################################
l=[0]*100000
for x in range(1,100):
	for y in range(1,100):
		for z in range(1,100):
			l[x*x+y*y+z*z+x*y+x*z+y*z]+=1
def main():
	n=aint()
	for i in range(1,n+1):
		print(l[i])
	return

#t=int(input())

########################################################
for i in range(t):                                     #
	#print("Case #"+str(i+1)+":",end=" ")		       #
	main()                                             #

Submission status: Accepted

Solution code:
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):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v<=10000:
                ans[v]+=1
 
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

Solution code:
n=int(input())
Ans=[0]*n
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            num=x**2+y**2+z**2+x*y+y*z+z*x
            if num<=n:
                Ans[num-1]+=1
print(*Ans,sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v<=10000:
                ans[v]+=1

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict 
def main():
    N = int(input())
    ans = defaultdict(int)
    for i in range(1, 110):
        for j in range(1, 110):
            for k in range(1, 110):
                v = i*i+j*j+k*k+i*j+j*k+k*i
                ans[v] += 1
    for i in range(1, N+1):
        print(ans[i])
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys,math
#DEBUG=True
DEBUG=False
if DEBUG:
    f=open("202007_2nd/C_input.txt")
else:
    f=sys.stdin
# Find the number of triples of integers (x,y,z) such that
# (x+y)**2 + (y+z)**2 + (x+z)**2 = 2*N
N=int(f.readline().strip())
ans=[0 for _ in range(N)]
I=int(math.sqrt(N))
for __ in range(I):
    A2=N-((__+1)**2)
    if A2<=0:
        break
    I2=int(math.sqrt(A2))
    for ___ in range(I2):
        A3=A2-((___+1)**2)
        if A3<=0:
            break
        I3=int(math.sqrt(A3))
        for ____ in range(I3):
            tmp=((__+___+2)**2)+((___+____+2)**2)+((__+____+2)**2)
            if tmp<=2*N:
                ans[int(tmp/2)-1]+=1
            else:
                break
for _ in range(N):
    print(ans[_])
f.close()

Submission status: Accepted

Solution code:
n = int(input())
arr = [0] * (n + 1)

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
# num = []
# for e in sys.stdin:
#     num.append(map(int, e.split()))

N = int(input())

count = []
for i in range(N):
    count.append(0)

max = min(int(math.sqrt(N)), int(N/2))
l = []

for i in range(1, max+1):
    l.append(i)

h = itertools.combinations_with_replacement(l, 3)

# print(h)
for i,j,k in h:
    n = (i+j+k)**2 - i*j - j*k - k*i
    # print(n)

    if(n <=N):
        if(i==j==k):
            count[n-1]+=1
        elif(i==j or j==k or i == k):
            count[n-1]+=3
        else:
            count[n-1]+=6


for c in count:
    print(c)

# for n in range(1, N+1):
#     count = 0;
#     max = min(int(math.sqrt(n)), int(n/2))
#     l = []
#
#     for i in range(1, max+1):
#         l.append(i)
#
#     h = list(itertools.combinations_with_replacement(l, 3))
#     for i,j,k in h:
#         if n == (i+j+k)**2 - i*j - j*k - k*i:
#             if(i==j==k):
#                 count+=1
#             elif(i==j or j==k or i == k):
#                 count+=3
#             else:
#                 count+=6

    # for i in range(1, max+1):
    #     for j in range(1, max+1):
    #         for k in range(1, max+1):
    #             num = i**2 + j**2 + k**2 + i*j + j*k + k*i
    #             if n == num:
    #                 count+=1
    # print(count)


    # print(max)


    # l = []
    #
    # for i in range(1, max+1):
    #     l.append(i)
    #
    # # h = itertools.combinations_with_replacement(l, 3)
    #
    # for i,j,k in h:
    #     if n == i**2 + j**2 + k**2 + i*j + j*k + k*i:
    #         if(i==j==k):
    #             count+=1
    #         elif(i==j or j==k or i == k):
    #             count+=3
    #         else:
    #             count+=6
    # print(count)

Submission status: Accepted

Solution code:
N = int(input())
ans = [0] * (N + 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):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if N < n:
                continue
            ans[n] += 1
print(*ans[1:], sep='\n')

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())

ANS = [0] * (N+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 <= N:
                ANS[a] += 1

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

Submission status: Accepted

Solution code:
n=int(input())
N=10**4+20;M=103
a=[0 for _ in range(N)]
for x in range(1,M):
    for y in range(1,M):
        for z in range(1,M):
            res=x*x+y*y+z*z+x*y+y*z+z*x;
            if res<N:a[res]+=1
for i in range(n):
    print(a[i+1])

Submission status: Accepted

Solution code:
n=int(input())
ans=[0 for i in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v=i*i+j*j+k*k+i*j+i*k+j*k
      if v<10050:
        ans[v]+=1
for i in range(n):
  print(ans[i+1])

Submission status: Accepted

Solution code:
n = int(input())
a = [0 for _ in range(n+1)]
for i in range(1,n+1):
  if i*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):
      tmp = i*i + j*j + k*k + i*j + j*k + k*i
      if tmp<=n:
        a[tmp]+=1
      else:
        break
for i in range(1,n+1):
  print(a[i])

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    # import time
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    from copy import deepcopy
    # import numpy as np
    from numpy import random as np_random
    # import math
    import random
    input = stdin.readline

    ans_list = [0]*60001
    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
                ans_list[n] += 1

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

Submission status: Accepted

Solution code:
n = int(input())

l = {}
for i in range(1, n+1):
    l[i] = 0

for x in range(1, min(101, n)):
    for y in range(1, min(101, n)):
        for z in range(1, min(101, n)):
            m = (x + y + z) ** 2 - (x*y + y*z + z*x)
            if m <= n:
                l[m] += 1
for i in range(1, n+1):
    print(l[i])

Submission status: Accepted

Solution code:
N = int(input())
ans = [0 for _ in range(N + 1)]

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      v = x * x + y * y + z * z  + x * y + y * z + z * x
      if v > N:
        continue
      ans[v - 1] += 1

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

Submission status: Accepted

Solution code:
N=int(input())

max_x=int(N**0.5)
ans_list=[0]*N

for x in range(1,max_x):
    for y in range(1,max_x):
        for z in range(1,max_x):
            s=x**2+y**2+z**2+x*y+y*z+z*x
            if s<=N:
                ans_list[s-1]+=1
                
for i in range(N):
    print(ans_list[i])

Submission status: Accepted

Solution code:
n = int(input())
a = [0 for _ in range(n+1)]
for i in range(1,n+1):
  if i*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):
      tmp = i*i + j*j + k*k + i*j + j*k + k*i
      if tmp<=n:
        a[tmp]+=1
      else:
        break
for i in range(1,n+1):
  print(a[i])

Submission status: Accepted

Solution code:
N = int(input())

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

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
            if a < 10050:
                ans[a] += 1
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter
    n = int(readline())
    count = Counter()

    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
                count[a] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
ans=[0]*(n+1)
m=int(n**0.5)+1
for x in range(1,m):
    for y in range(1,m):
        for z in range(1,m):
            a=x**2+y**2+z**2+x*y+y*z+z*x
            if 1<=a<=n:
                ans[a]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()

    a = [0] * n

    r = 0
    for x in range(1, 100):
        t = x ** 2
        if t > n:
            break

        for y in range(1, 100):
            u = t + y ** 2 + x * y
            if u > n:
                break

            for z in range(1, 100):
                v = u + z ** 2 + y * z + z * x
                if v > n:
                    break

                a[v-1] += 1

    return JA(a, "\n")


print(main())

Submission status: Accepted

Solution code:
n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
def f(x,y,z):
    return x**2 + y**2 +z**2 +x*y+y*z+z*x
dic={}
for i in range(1,n+1):
    dic[i]=0
for x in range(1,101):
    for y in range(1,100):
        for z in range(1,100):
            if f(x,y,z)<=n:
                dic[f(x,y,z)]=dic.get(f(x,y,z),0)+1
for i in range(1,n+1):
    print(dic[i])

Submission status: Accepted

Solution code:
N = int(input())
a = [0]*10050
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+i*k+j*k
            if v <= 10000:
                a[v-1] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i * i + j * j + k * k + i * j + j * k + k * i
      if v < 10050:
        ans[v] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
l = [0]*N
upper = round((N-1)**0.5-1)
for x in range(1, upper+1):
    for y in range(1, upper + 1):
        for z in range(1, upper + 1):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if tmp < N+1:
                l[tmp-1]+=1
for x in l:
    print(x)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


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

    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
                A[tmp] += 1

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
dp = [0] * (500000)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            pe = x**2 + y**2 + z**2 + x*y + y*z + z*x
            dp[pe] += 1
print(*dp[1:n+1],sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  ans = [0]*N
  for x in range(1,101):
    for y in range(1,101):
      for z in range(1,101):
        left = x*x+y*y+z*z+x*y+y*z+z*x
        if left<=N:
          ans[left-1] += 1
  return ans
print(*solve(),sep='\n')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    n = int(input())
    ans = [0 for _ in range(10 ** 6 + 2000)]
    candidate = 110

    for x in range(1, candidate + 1):
        for y in range(1, candidate + 1):
            for z in range(1, candidate + 1):
                total = 0
                total += (x ** 2) + (y ** 2) + (z ** 2)
                total += (x * y) + (y * z) + (z * x)

                if total < (10 ** 6 + 2000):
                    ans[total] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v < 10050:
                ans[v] += 1
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

Solution code:
N = int(input())

ans=[0]*N

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(N>=F):
        ans[F-1] += 1
        
for i in ans:
  print(i)

Submission status: Accepted

Solution code:
def foo(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

N = int(input())

A = [0 for i in range(10050)]

for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            tmp = foo(i,j,k)
            if tmp < 10050:
                A[tmp] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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):
            v = x**2+y**2+z**2+x*y+y*z+x*z
            if v < 10001:
                ans[v] += 1

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

Submission status: Accepted

Solution code:
import math

n = int(input())
ans = [0]*n
root = n ** 0.5

for x in range(1, math.floor(root) + 1):
    for y in range(1, math.floor(root) + 1):
        for z in range(1, math.floor(root) + 1):
            result = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if result <= n:
                ans[result - 1] += 1

for num in ans:
    print(num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

cnt = [0] * (6 * 10000 + 1)

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

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

cnt = [0] * 10010

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

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0] * 10001
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < len(ans):
                ans[n] += 1
for n in range(1, N + 1):
    print(ans[n])

Submission status: Accepted

Solution code:
n = int(input())

cnt = [set() for i in range(n+1)]

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

for x in range(1, n+1):
    if f(x,1,1) > n: break
    for y in range(1, n+1):
        if f(x,y,1) > n: break
        for z in range(1, n+1):
            t = f(x,y,z)
            if t > n: break
            cnt[t].add((x,y,z))

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

Submission status: Accepted

Solution code:
def solve(n):
    D = {k: 0 for k in range(1, n+1)}
    m = int(n**0.5)
    for x in range(1, m+1):
        for y in range(1, m+1):
            for z in range(1, m+1):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= n:
                    D[k] += 1
                else:
                    break
    for k in range(1, n+1):
        print(D[k])

n = int(input())
solve(n)

Submission status: Accepted

Solution code:
N=int(input())

a=[0]*10**4

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

for n in range(N):
    print(a[n])

Submission status: Accepted

Solution code:
list=[0 for i in range(10**4+1)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            var=x**2 +y**2 +z**2 +x*y +y*z +z*x
            if var<=10**4:
                list[var]+=1
            
n=int(input())
for i in range(1,n+1):
    print(list[i])

Submission status: Accepted

Solution code:
n = int(input())
l = [0]*(n+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+x*z+y*z
            if(ans>n):
                continue
            l[ans] += 1

print(*l[1:])

Submission status: Accepted

Solution code:
N=int(input())
a=[0]*10**4
for j in range(1,101):
    for k in range(1,101):
        for h in range(1,101):
            tmp=h**2+j**2+k**2+h*j+j*k+k*h
            if tmp<=10000:
                a[tmp-1]+=1
for i in range(N):
    print(a[i])

Submission status: Accepted

Solution code:
N = int(input())
f = [0]*N
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      n=x**2+y**2+z**2+x*y+y*z+z*x
      if n<=N:
        f[n-1]+=1
print(*f,sep="\n")

Submission status: Accepted

Solution code:
import math
import numpy as np

def  XYZTriplets():

    num = int(input())
    
    list_num = []
    
    count = [0]*num
    
    for i in range(1, num+1):
        list_num.append(i)

    for x in range(1, int(math.sqrt(num))):
        for y in range(1, int(math.sqrt(num))):
            for z in range(1, int(math.sqrt(num))):
                
                function = x*x + y*y + z*z + x*y + y*z + z*x
                
                if function <= num and function > 0:
                    count[function-1] = count[function-1] + 1
 
    for i in range(0, num):
        print(count[i])
        

if __name__ == '__main__':
    XYZTriplets()

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * 10050

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            zzz = (x + y + z) ** 2 - x * y - y * z - x * z
            if zzz < 10050:
                ans[zzz] += 1

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

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

cnt = [0] * 10001

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

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

Submission status: Accepted

Solution code:
f = [0] * 10001
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n > 10000:
                break
            f[n] += 1

N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
r=[0]*10000
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 + i*k + k*j
            if v <= 10000:
                r[v-1] += 1
for i in range(N):
    print(r[i])

Submission status: Accepted

Solution code:
N=int(input())
r=[0]*10000
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            v = i*i + j*j + k*k + i*j + i*k + k*j
            if v <= 10000:
                r[v-1] += 1
for i in range(N):
    print(r[i])

Submission status: Accepted

Solution code:
n=int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(n + 1)]
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            v = i*i + j*j + k*k +i*k +k*j+j*i
            if v < n+1:
                ans[int(v)] += 1
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

Solution code:
N = int(input())

cnt = [0] * (10 ** 4 + 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 <= 10 ** 4:
                cnt[f] += 1

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

Submission status: Accepted

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