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:
import sys
import itertools as itr
readline = sys.stdin.buffer.readline
N=int(readline())
n=int(pow(N,0.5))
chk=list(itr.product(range(1,n),repeat=3))
cnt=[0]*(N+1)
for c in chk:
  i=c[0]
  j=c[1]
  k=c[2]
  if i*i+j*j+k*k+i*j+j*k+k*i<=N:
    cnt[i*i+j*j+k*k+i*j+j*k+k*i]+=1
for i in range(1,N+1):
  print(cnt[i])

Submission status: Accepted

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

for i in l:
  print(i)

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

Submission status: Accepted

Solution code:
import sys
import itertools as itr
readline = sys.stdin.buffer.readline



N=int(readline())
n=int(pow(N,0.5))
chk=list(itr.product(range(1,n),repeat=3))
cnt=[0]*(N+1)
for _ in range(len(chk)):
  i=chk[_][0]
  j=chk[_][1]
  k=chk[_][2]
  if pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i<=N:
    cnt[pow(i,2)+pow(j,2)+pow(k,2)+i*j+j*k+k*i]+=1
          

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

Submission status: Accepted

Solution code:
n = int(input())
answer = [0 for _ in range(n)]

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:
                answer[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i - 1] = answer[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i - 1] + 1
for i in range(n):
    print(answer[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(10001)]
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+j*k+k*i
            if v < 10001:
                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, 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):
            tmp_n = x*y+x*z+y*z+x**2+y**2+z**2
            if tmp_n <= n:
                ans[tmp_n-1] += 1
for a in ans:
    print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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
            num[ans] += 1
            
print(*num[1:N+1], sep ='\n')

Submission status: Accepted

Solution code:
N = int(input())

ans = [0]*(N+1)

for i in range(1, int(N**0.5)+1):
    for j in range(1, int(N**0.5)+2):
       for k in range(1, int(N**0.5)+2):
            f = i*i + j*j + k*k +i*j + j*k + k*i
            if f <= N:
                ans[f] += 1
print(*ans[1:], sep='\n')

Submission status: Accepted

Solution code:
N = int(input())
cnt = [0] * (N+1)
for x in range(1, int(N**0.5)+1):
    for y in range(1, int(N**0.5)+1):
        fxy = x**2 + y**2 + x*y
        if N < fxy: break
        for z in range(1, int(N**0.5)+1):
            f = fxy + z**2 + y*z + z*x
            if N < f: break
            cnt[f] += 1
print(*cnt[1:], sep='\n')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

# C - XYZ Triplets
def calc(x, y, z):
	return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


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):
			i = calc(x, y, z)
			
			if i > N:
				break
			else:
				ans[i] += 1

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

N = int(readline())

ans = [0] * (N + 1)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n=int(input())
ans=[0 for i in range(10500)]
for i in range(1,105):
  for j in range(1,i+1):
    for k in range(1,j+1):
      sumg=(i+j)**2+(j+k)**2+(k+i)**2
      if sumg<21000:
        if i==j and j==k:
          ans[int(sumg/2)]+=1
        elif i!=j and j!=k and k!=i:
          ans[int(sumg/2)]+=6
        else:
          ans[int(sumg/2)]+=3
for i in range(n):
  print(ans[i+1])

Submission status: Accepted

Solution code:
from math import sqrt
n = int(input())
sqn_int = int(sqrt(n))
a = [0] * n
for x in range(1, 1 + sqn_int):
    for y in range(1, 1 + sqn_int):
        for z in range(1, 1 + sqn_int):
            left = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if left <= n:
                a[left - 1] += 1
for i in a[:n]:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())
L = [0]*(110**2*6+1)

for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            a = i**2 + j**2 + k**2 + i*j +j*k + k*i
            if a <= n:
                L[a-1] +=1
for i in range(n):
    print(L[:n+1][i])

Submission status: Accepted

Solution code:
N = int(input())

from collections import defaultdict
res = defaultdict(list)

# 解の候補を生成
# x,y,zそれぞれに対して√10000位までやればよさそう
limit = int(10000**.5)+1
for x in range(1, limit):
    for y in range(1, limit):
        for z in range(1, limit):
            f = x**2 + y**2 + z**2 + x*y + y*z + z*x
            res[f].append((x,y,z))

for i in range(1, N+1):
    # 重複組み合わせは除外する
    print(len(set(res[i])))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math

n = int(input())
arr = [0] * n

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
            if ans <= n:
                arr[ans - 1] += 1

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

Submission status: Accepted

Solution code:
import collections
import sys
input=sys.stdin.readline

n=int(input())
ans=[0]*n
tmp=[]
for x in range(1,int(n**0.5)+1): #可能なすべてのx,y,zについてx^2+y^2+z^2+xy+yz+zxの値を求める
   for y in range(1,int(n**0.5)+1):
       for z in range(1,int(n**0.5)+1):
           tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)
cnt=collections.Counter(tmp) #x^2+y^2+z^2+xy+yz+zxの値の個数を数える
for i in range(1,n+1): #各iについて、x^2+y^2+z^2+xy+yz+zxの値がiであるものの個数が答えとなる
   print(cnt[i])

Submission status: Accepted

Solution code:
import sys
from math import ceil

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    
    ans = [0] * (N + 1)
    for x in range(1, ceil(N ** 0.5) + 1):
        for y in range(1, ceil(N ** 0.5) + 1):
            for z in range(1, ceil(N ** 0.5) + 1):
                n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if n <= N:
                    ans[n] += 1
    print(*ans[1:], sep='\n')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math

n = int(input())
ans_list = [0 for i in range(n+1)]

for i in range(1,101):
    for j in range(1, 101):
        for k in range(1, 101):
            temp = i*i + j*j + k*k + i*j + j*k + k*i
            if temp <= n:
                ans_list[temp] += 1

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

N = int(input())
ans = [0 for _ in range(105**3)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            ans[idx-1] += 1
for i in range(N):
    print(ans[i])

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

N = int(input())
n_np = np.zeros(105**3)
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            n_np[idx-1] += 1
for i in range(N):
    print(int(n_np[i]))

Submission status: Accepted

Solution code:
n = int(input())
r = range(1, int(n**.5) + 1)
a = [0] * -~n
for x in r:
  for y in r:
    for z in r:
      f = x*x + y*y + z*z + x*y + y*z + z*x
      if f <= n:a[f] += 1
for b in a[1:]:print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = [0 for _ in range(10005)]

    for i in range(1,100):
        for j in range(1,100):
            for k in range(1,100):
                v = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if v < 10005:
                    ans[v]+=1
    for i in range(1,N+1):
        print(ans[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# C - XYZ Triplets
from collections import Counter


def main():
    N = int(input())
    calc = lambda x, y, z: x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    lim = int(N ** 0.5) + 1
    cnt = Counter(
        calc(i, j, k)
        for i in range(1, lim + 1)
        for j in range(1, lim + 1)
        for k in range(1, lim + 1)
    )
    res = [cnt[i] for i in range(1, N + 1)]
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# C - XYZ Triplets
from collections import Counter


def main():
    N = int(input())
    calc = lambda x, y, z: x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    cnt = Counter(
        calc(i, j, k)
        for i in range(1, 101)
        for j in range(1, 101)
        for k in range(1, 101)
    )
    res = [cnt[i] for i in range(1, N + 1)]
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    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**2 + j**2 + k**2 + i*j + j*k + k*i
            if v < 10001:
                ans[v] += 1

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

#print(1e+5)
ans = np.zeros(int(1e+5),dtype = int)
for x in range(1,int(N**0.5+1)):
  for y in range(x,int((N-x**2)**0.5+1)):
    for z in range(y,int((N-x**2-y**2)**0.5+1)):
      n = x**2 + y**2 + z**2 +x*y+y*z+z*x
      num = len({x,y,z})
      if num == 1:
        ans[n] += 1
      elif num == 2:
        ans[n] += 3
      elif num == 3:
        ans[n] += 6

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0 for _ in range(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:
                ans[n-1] += 1


print(*ans, sep="\n")

Submission status: Accepted

Solution code:
import collections
import sys
input = sys.stdin.readline

n= int(input())
# ans = [0]*n
tmp = []

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):
            tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)
cnt = collections.Counter(tmp)

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n=int(input())

a=[0]*(n)
for j in range(1,n+1):
    for k in range(1,n+1):
        for l in range(1,n+1):
            if j**2+k**2+l**2+j*k+k*l+l*j>n:
                break
            else:
                a[j**2+k**2+l**2+j*k+k*l+l*j-1]+=1

for i in a:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())
cnt = [0] * 11000

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            if value <= n:
                cnt[value] += 1

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

Submission status: Accepted

Solution code:
import math
def equal(x,y,z):
    return x**2 + y**2 + z**2 +x*y+y*z+z*x

N = int(input())
ans = [0 for _ in range(10050)]
for x in range(1,105):
        for y in range(1,105):
            for z in range(1,105):
                v = equal(x,y,z)
                if v < 10050:
                    ans[v]+=1
for i in range(N):
    print(ans[i+1])

Submission status: Accepted

Solution code:
#C
N = int(input())

count = [0] * 10050
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v < 10050:
                count[v] += 1

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math

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

Submission status: Accepted

Solution code:
import math

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

n = int(input())
fs = [0] * n

lim = math.floor(math.sqrt(n))
rng = range(1, lim)

for x in rng:
  for y in rng:
    for z in rng:
      v = f(x, y, z)
      if v <= n:
      	fs[v - 1] += 1
      
for i in range(n):
  print(fs[i])

Submission status: Accepted

Solution code:
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
N=II()
#ans=[0 for _ in range(10050)]
ans=[0]*10050
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      n=i*i+j*j+k*k+i*j+j*k+k*i
      if n<10050:
        ans[n]+=1
for i in range(1,N+1):
  print(ans[i])

Submission status: Accepted

Solution code:
from itertools import product
n = int(input())

nums = [0]*(n+1)
for i in product(range(1, int(n**0.5)+1),repeat=3):
  t = i[0]**2 + i[1]**2 + i[2]**2 + i[0]*i[1] + i[1]*i[2] + i[0]*i[2]
  if t <= n: nums[t] += 1

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

Submission status: Accepted

Solution code:
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
N=II()
ans=[0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      n=i*i+j*j+k*k+i*j+j*k+k*i
      if n<10050:
        ans[n]+=1
for i in range(1,N+1):
  print(ans[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [0 for _ in range(101**3+1)]
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      p = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if p <= 10010:
        a[p] += 1
for i in range(1,n+1):
  print(a[i])

Submission status: Accepted

Solution code:
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):
                if(i**2 + j**2 + k**2 +i*j+j*k + k*i<=n):
                    res[i**2 + j**2 + k**2 +i*j+j*k + k*i]+=1
                    
    for i in range(1,n+1):
        print(res[i])
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())

cnts = [0] * (n + 1)
sn = int(math.sqrt(n)) + 1
for x in range(1, sn + 1):
  for y in range(1, sn + 1):
    for z in range(1, sn + 1):
      g = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
      if 1 <= g <= n:
        cnts[g] += 1

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

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=[0]*n
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            num=(i+j+k)**2-(i*j+j*k+k*i)
            if num<=n:
                ans[num-1]+=1
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
from math import sqrt


def check(i, j, k):
    cnt = set([i, j, k])
    if len(cnt) == 1:
        return 1
    if len(cnt) == 2:
        return 3
    if len(cnt) == 3:
        return 6


N = int(input())
ans = [0] * N

R = int(sqrt(N))
for x in range(1, R + 1):
    for y in range(x, R + 1):
        for z in range(y, R + 1):
            f = (x ** 2) + (y ** 2) + (z ** 2) + (x * y) + (y * z) + (z * x)
            if f <= N:
                ans[f - 1] += check(x, y, z)
print(*ans, sep='\n')

Submission status: Accepted

Solution code:
N = int(input())
ans = [0] * (10**4+1)

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

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

Submission status: Accepted

Solution code:
from itertools import permutations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(1,N+1):
        if x**2+y**2>N:
            break
        for z in range(1,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
                    
for i in range(N):
    print(ans[i])

Submission status: Accepted

Solution code:
def F(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
dic = [0]*(10**4+1)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            temp = F(x,y,z)
            if temp<10**4+1:
                dic[temp] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * (n + 1)
a = [1, 3, 6]
for x in range(1, int(n**0.5) + 1):
    for y in range(x, int(n**0.5) + 1):
        for z in range(y, int(n**0.5) + 1):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v <= n:
                ans[v] += a[len(set([x, y, z])) - 1]
print(*ans[1:], sep='\n')

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

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

Submission status: Accepted

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

#解説を読んで考えている。
#まず、探索範囲は ceil(√N)程度で良いとされた。
# これはxyzが1以上のため、
# x=最大,yz=1のケースでは、 x*x + 2x + 2 = N となるため。

import io
import sys
import math

def format_multi_line_answer(lst):
    ans = ""
    for y in lst:
        ans += f"{y}\n"
    return ans

#この演算fは、n+1に至るまで都度同じ計算をする。
def f(n):
    v_lst = [0] * (n+1)
    for x in range(1,105):  #ここの最適化も必須（Pythonでは？)
        for y in range(1,105):
            for z in range(1,105):
                # ここでnは f(i)ループのiに相当していた。ジャスト 時に追加する必要はない。
                # if ff(x,y,z) == n:
                v = ff(x,y,z) 
                if v <= n:  #よく見る、配列インデックスを直接キーとして利用する発想。
                    v_lst[v] += 1
    return v_lst

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

def solve(n):
    # implement process
    ans_l = []
    
    # ループ処理は一回だけ通す。
    v_lst = f(n)

    # 配列に必要な値が全て乗っている
    for v in v_lst[1:]:
        ans_l.append(v)

    return format_multi_line_answer(ans_l)

def main():
    # input
    n = int(input())
    # process
    ans = str( solve(n) )
    
    # output
    print(ans)
    return ans
        
### DEBUG I/O ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
"""+str(10000)

_EXPECTED = """\
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0


"""

def logd(str):
    """usage:
    if _DEB: logd(f"{str}")
    """
    if _DEB: print(f"[deb] {str}")

### MAIN ###
if __name__ == "__main__":
    if _DEB:
        sys.stdin = io.StringIO(_INPUT)
        print("!! Debug Mode !!")

    ans = main()

    if _DEB:
        print()
        if _EXPECTED.strip() == ans.strip(): print("!! Success !!")
        else: print(f"!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

Submission status: Accepted

Solution code:
N = int(input())
ans = [0]*(10**4+10)

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import collections
import sys
input=sys.stdin.readline

n=int(input())
ans=[0]*n
tmp=[]
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):
            tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)

cnt=collections.Counter(tmp)
for i in range(1,n+1):
    print(cnt[i])

Submission status: Accepted

Solution code:
N=int(input());a=[0]*10_001;X=Y=Z=range(1,101)
for x in X:
    for y in Y:
        for z in Z:
            if (n:=x*x+y*y+z*z+x*y+y*z+z*x)<N+1:a[n-1]+=1
print(*a[:N],sep='\n')

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            m = ((i ** 2) + (j ** 2) + (k ** 2) + (i * j) + (j * k) + (k * i))
            if m < 10001:
                ans[m-1] += 1

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    f = [0] * (N+1)
    for x in range(1,100):
        for y in range(1,100):
            for z in range(1,100):
                tmp = x*x + y*y + z*z + x*y + y*z + z*x
                if tmp <= N:
                    f[tmp] += 1
    
    print("\n".join(map(str, f[1:])))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())
maximum = int(sqrt(n))
f = [0] * (n + 1)

for x in range(1, maximum):
  for y in range(1, maximum):
    for z in range(1, maximum):
      value = x*x + y*y + z*z + x*y + y*z + z*x
      if value <= n:
        f[value] += 1
for f_i in f[1:]:
  print(f_i)

Submission status: Accepted

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

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
            if n < N+1:
                ans[n-1] += 1

print(*ans[:N],sep='\n')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    d = [0 for _ in range(N)]
    r = 100
    ii = 0
    for i in range(1, r):
        ii += 2* i - 1
        for j in range(1, i + 1):
            s = i + j
            c = ii + s * j
            l = 6
            if i == j:
                l = 3
            if c + 1 + s > N:
                break
            for k in range(1, j + 1):
                c += 2* k - 1 + s
                if c <= N:
                    if j == k:
                        l = 3
                        if i == k:
                            l = 1
                    d[c - 1] += l
                else:
                    break
    print(*d, sep="\n")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<=n:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * 100000
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      idx = x**2 + y**2 + z**2 + x*y + y*z + z*x
      ans[idx] += 1
for i in ans[1:n+1]:
  print(i)

Submission status: Accepted

Solution code:
from math import sqrt
n=int(input())
ans=[0]*n
for x in range(1,int(sqrt(n))+10):
    for y in range(1,int(sqrt(n))+10):
        for z in range(1,int(sqrt(n)+10)):
            v=x**2+y**2+z**2+x*y+y*z+z*x
            if v<=n:
                ans[v-1]+=1
for a in ans:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    f = [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:
                    f[tmp] += 1
    
    print("\n".join(map(str, f[1:])))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = [0]*(10**4+50)

for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = (i**2)+(j**2)+(k**2)+i*j+j*k+k*i
      if v<10**4+50:
        cnt[v] += 1
for i in range(1,n+1):
  print(cnt[i])

Submission status: Accepted

Solution code:
import sys
from itertools import permutations, combinations


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


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    f = [0] * (n + 1)

    i = 1
    while g(i, i, i) <= n:
        f[g(i, i, i)] += 1
        i += 1

    for p in permutations(range(1, 101), 2):
        if g(p[0], p[0], p[1]) <= n:
            f[g(p[0], p[0], p[1])] += 3

    for p in combinations(range(1, 101), 3):
        if g(p[0], p[1], p[2]) <= n:
            f[g(p[0], p[1], p[2])] += 6

    for e in f[1:]:
        print(e)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt
n = int(input())

n_cnt = [0]*n

for x in range(1, int(sqrt(2*n))+1):
    for y in range(1, int(sqrt(2*n))+1):
        for z in range(1, int(sqrt(2*n))+1):
            t = (x+y)**2 + (y+z)**2 + (z+x)**2
            if t % 2 == 0 and t // 2 - 1 < n:
                n_cnt[t // 2 - 1] += 1


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ret = [0 for _ in range(1,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):
	for y in range(1,n+1):
		for z in range(1,n+1):
			if f(x,y,z) > n:
				z = 1
				break
			ret[f(x,y,z)-1] += 1
		if f(x,y,z) > n:
			y = 1
			break
	if f(x,y,z) > n:
		x = 1
		break

for i in ret:
	print(i)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    d = [0] * N
    r= 100
    for i in range(1, r):
        ii = i * i
        for j in range(1, i + 1):
            iji = ii + j * j + i * j
            l =6
            if iji + 1 + i + j > N:
                break
            for k in range(1, j + 1):
                c = iji + k * k + (i + j) * k
                if c <= N:
                    if i == j or j == k:
                        l = 3
                        if i == k:
                            l = 1
                    d[c - 1] += l
                else:
                    break
    print(*d, sep="\n")


if __name__ == "__main__":
    main()