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())
chk = [0] * (10 ** 4 + 2)
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            a = i**2 + j**2 + k**2 + i*j + j*k + i*k
            if a > 10001:
                break
            chk[a] += 1
for i in range(N):
    print(chk[i+1])

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import math
import sys


def calc_p(a, b, c):
    u = {a, b, c}
    if len(u) == 3:
        return 6
    if len(u) == 2:
        return 3
    if len(u) == 1:
        return 1
    else:
        raise


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


def _main():
    N = int(std_in())
    fn = [0] * N
    if N == 1:
        x_max = 1
    else:
        x_max = int(math.sqrt(N - 2)) - 1

    n2 = [i**2 for i in range(1, x_max + 1)]

    ij = [[0 for _ in range(1, x_max + 1)] for _ in range(1, x_max + 1)]
    for i in range(x_max):
        for j in range(i, x_max):
            ij[i][j] = (i+1) * (j+1)

    for x in range(1, x_max + 1):
        y_min = x
        x2 = n2[x-1]
        for y in range(y_min, x_max + 1):
            z_min = y
            y2 = n2[y-1]
            xy = ij[x-1][y-1]
            tmp_n = x2 + xy + y2
            if tmp_n > N:
                break
            for z in range(z_min, x_max + 1):
                z2 = n2[z-1]
                yz = ij[y-1][z-1]
                zx = ij[x-1][z-1]
                n = tmp_n + z2 + yz + zx
                if n > N:
                    break
                fn[n-1] += calc_p(x, y, z)

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


if __name__ == "__main__":
    _main()

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def calc_p(a, b, c):
    u = {a, b, c}
    if len(u) == 3:
        return 6
    if len(u) == 2:
        return 3
    if len(u) == 1:
        return 1
    else:
        raise


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


def _main():
    N = int(std_in())
    fn = [0] * (N + 1)
    if N == 1:
        x_max = 1
    else:
        x_max = int(pow(N, 0.5)) - 1

    n2 = [i**2 for i in range(1, x_max + 1)]

    ij = [[0 for _ in range(1, x_max + 1)] for _ in range(1, x_max + 1)]
    for i in range(x_max):
        for j in range(i, x_max):
            ij[i][j] = (i+1) * (j+1)

    for x in range(1, x_max + 1):
        y_min = x
        x2 = n2[x-1]
        for y in range(y_min, x_max + 1):
            z_min = y
            y2 = n2[y-1]
            xy = ij[x-1][y-1]
            tmp_n = x2 + xy + y2
            if tmp_n > N:
                break
            for z in range(z_min, x_max + 1):
                z2 = n2[z-1]
                yz = ij[y-1][z-1]
                zx = ij[x-1][z-1]
                n = tmp_n + z2 + yz + zx
                if n > N:
                    break
                fn[n] += calc_p(x, y, z)

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


if __name__ == "__main__":
    _main()

Submission status: Accepted

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

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

for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import math
import sys


def calc_p(a, b, c):
    u = {a, b, c}
    if len(u) == 3:
        return 6
    if len(u) == 2:
        return 3
    if len(u) == 1:
        return 1
    else:
        raise


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


def _main():
    N = int(std_in())
    fn = [0] * (N + 1)
    if N == 1:
        x_max = 1
    else:
        x_max = int(math.sqrt(N - 2)) - 1

    n2 = [i**2 for i in range(1, x_max + 1)]

    ij = [[0 for _ in range(1, x_max + 1)] for _ in range(1, x_max + 1)]
    for i in range(x_max):
        for j in range(i, x_max):
            ij[i][j] = (i+1) * (j+1)

    for x in range(1, x_max + 1):
        y_min = x
        x2 = n2[x-1]
        for y in range(y_min, x_max + 1):
            z_min = y
            y2 = n2[y-1]
            xy = ij[x-1][y-1]
            tmp_n = x2 + xy + y2
            if tmp_n > N:
                break
            for z in range(z_min, x_max + 1):
                z2 = n2[z-1]
                yz = ij[y-1][z-1]
                zx = ij[x-1][z-1]
                n = tmp_n + z2 + yz + zx
                if n > N:
                    break
                fn[n] += calc_p(x, y, z)

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


if __name__ == "__main__":
    _main()

Submission status: Accepted

Solution code:
N = int(input())

ans = [0 for _ in range(10**4+50)]

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < 10**4+50:
                ans[tmp] += 1

for i in range(1, N+1):
    print(ans[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:
from math import sqrt, ceil

N = int(input())

result = [0] * (N + 1)
t = ceil(sqrt(N))
for x in range(1, t + 1):
    for y in range(1, t + 1):
        for z in range(1, t + 1):
            n = x * x + y * y + z * z + x * y + y * z + z * x
            if n > N:
                break
            result[n] += 1

print(*result[1:], sep='\n')

Submission status: Accepted

Solution code:
n = int(input())
sqn = int(n**0.5)+1
f = [0] * (n+1)
for x in range(1,sqn):
    for y in range(1, sqn):
        for z in range(1, sqn):
            nn = x*x + y*y + z*z + x*y + y*z + z*x
            if nn <= n : f[nn]+=1
for i in range(1,n+1):
    print(f[i])

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

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0] * (N+1)   # 答え用のリストを用意する

for x in range(1,100):      # Nの上限が10**4なのでルート(10**4)までで計算
    for y in range(1,100):
        for z in range(1,100):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if a <= N:      # 条件より計算結果aはNを超えてはならない
                n = a       # 計算結果aがn（インデックス番号）となるように
                ans[n] += 1 #リストのn番目のインデックスでカウント
      
for n in range(1,N+1):
    print(ans[n])

Submission status: Accepted

Solution code:
import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
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 ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

N = INT()

C = Counter()
for x in range(1, N+1):
    for y in range(1, N+1):
        if x**2 + y**2 + x*y > N:
            break
        for z in range(1, N+1):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n > N:
                break
            C[n] += 1

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

Submission status: Accepted

Solution code:
import math
N = int(input())
X = math.ceil(math.sqrt(N))
li = [0]*N
xyz = []
for i in range(X):
    for j in range(X-i):
        for k in range(X-i-j):
            xyz1 = [i+1,j+i+1,k+j+i+1]
            xyz1.sort()
            if i+1 == j+i+1 == k+j+i+1:xyz1.append(1)
            elif i+1 != j+i+1 and i+1 != k+j+i+1 and j+i+1 != k+j+i+1:xyz1.append(6)
            else:xyz1.append(3)
            xyz.append(xyz1)
xyz.sort()
for l in xyz:
    n = l[0]**2 + l[1]**2 + l[2]**2 + l[0]*l[1] + l[1]*l[2] + l[2]*l[0]
    try:
        li[n-1] += l[3]
    except:pass
for n in li[0:N:]:
    print(n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import itertools
from collections import defaultdict

def main():
    N = int(input())
    A = defaultdict(int)
    for x in range(1,N+1):
        breakflag = False
        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 + z*x
                # print(x,y,z,a,A)
                if a <= N:
                    A[a] += 1
                else:
                    break
    for i in range(N):
        print(A[i+1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = int(input())

x = [0] * (a+1)
for xi in range(1,101):
    for yi in range(1,101):
        for zi in range(1,101):
            result = xi**2 + yi**2 + zi**2 + xi*yi + yi*zi + zi*xi
            if result <= a:
                x[result] += 1 
for i in range(1, a+1):
    print(x[i])

Submission status: Accepted

Solution code:
n = int(input())

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

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 < 10001:
                ans[v] += 1

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

Submission status: Accepted

Solution code:
n=int(input())
m = int(n ** (0.5)) + 1
ans=[0]*(n+1)
for i in range(1,m):
    a=i**2
    for j in range(1,m):
        b=a
        b+=j**2+i*j
        for k in range(1,m):
            c=b
            c+=k**2+j*k+k*i
            if c<n+1:
                ans[c]+=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, 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):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= N:
                ans[n-1] += 1

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

Submission status: Accepted

Solution code:
from sys import stdin
from collections import defaultdict
N = int(stdin.readline().rstrip())
d = defaultdict(int)

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 + z*x
      d[v] += 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
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(N):
    print(ans[i+1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

count = [0 for i in range(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:
        count[f] += 1

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy
n = int(input())
#l, r, d = map(int, sys.stdin.readline().split())
#s = input()
#a = list(map(int, sys.stdin.readline().split()))

ans = [0 for i in range(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:
                break
            
            ans[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i] += 1

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

Submission status: Accepted

Solution code:
ans = [0 for _ in range(10001)]
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			w = x*x + y*y + z*z + x*y + y*z + z*x
			if w <= 10000:
				ans[w] += 1
print(*ans[1:int(input())+1], sep="\n")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = [0] * n

for i in range(1, int((n+1)**0.5)):
    for j in range(i,int((n+1)**0.5)):
        for k in range(j,int((n+1)**0.5)):
            s = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if s > n:
                break
            
            check = len(set([i,j,k]))
            if check == 1:
                ans[s-1] += 1
            elif check == 2:
                ans[s-1] += 3
            elif check == 3:
                ans[s-1] += 6

for i in ans:
    print(i)

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):
            s = x*x + y*y + z*z
            s += x*y + y*z + z*x
            if (s > n):
                continue
            else:
                ans[s] += 1

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

Submission status: Accepted

Solution code:
n=int(input())

a=[0]*n

for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      k=x*x+y*y+z*z+x*y+y*z+z*x
      if k <=n:
        a[k-1]+=1
        
for q in range(n):
  print(a[q])

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
res = [0]*(n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            x = i*i + j*j + k*k + i*j + j*k + k*i
            if x <= n:
                res[x] += 1
for i in range(1,n+1):
    print(res[i])

Submission status: Accepted

Solution code:
n = int(input())

ans = [0 for _ in range(10001)]
for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      v = x**2 + y**2 + z**2 + x*y + y*z + z*x
      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+1)
i = 102
for x in range(1,i):
    for y in range(1,i):
        for z in range(1,i):
            total = (x + y + z)**2 - (x*y + y*z + x*z)
            if total <= N:
                ans[total] += 1

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

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):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

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

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):
            s = x**2 + y**2 + z**2 + 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:
# -*- coding: utf-8 -*-

import math


def g(nx, ny, nz):
    return nx ** 2 + ny ** 2 + nz ** 2 + nx * ny + ny * nz + nz * nx


def solve(n):
    # min_z = max(1, int(math.sqrt(n) / 3))
    max_z = max(1, int(math.sqrt(n - 2) - 1) if n > 2 else 1)
    # max_x = max(1, int(math.sqrt(n / 3) + 1))
    
    counter = [0 for _ in range(n + 1)]
    
    for z in range(1, max_z + 1):
        for y in range(1, max_z + 1):
            for x in range(1, max_z + 1):
                gn = g(x, y, z)
                if gn <= n:
                    counter[gn] += 1
    
    for i in range(1, n + 1):
        print(counter[i])


N = int(input())

solve(N)

Submission status: Accepted

Solution code:
import itertools

N = int(input())

tbl = [0]*N

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

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

Submission status: Accepted

Solution code:
n = int(input())

table = [0]*(10**4+100)

for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            total = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if total < 10100:
                table[total] += 1
            
for i in range(n):
    print(table[i+1])

Submission status: Accepted

Solution code:
N = int(input())

C = [0] * (60001)

for x in range(1, 100):
    for y in range(x, 100):
        for z in range(y, 100):
            v = x * x + y * y + z * z + x * y + y * z + z * x
            k = 6
            if x == y == z:
                k = 1
            elif x == y or y == z:
                k = 3
            C[v] += k

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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):
            w = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if w <= n:
                ans[w] += 1
for i in range(1, n + 1):
    print(ans[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

result = [0] * (n+1)
for x in range(1,99):
  for y in range(1,99):
    for z in range(1,99):
      fn = x*x + y*y + z*z + x*y + y*z + z*x
      if fn > n:
        break
      result[fn] += 1

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

Submission status: Accepted

Solution code:
def main():
    num = int(input())
    counter = [0] * (num + 1)
    # func(41, 41, 41) = 10086
    # func(99, 1, 1) = 10002
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 123 - x - y + 1):
                tmp = (x + y + z) ** 2 - x * y - y * z - z * x
                if tmp > num:
                    break
                counter[tmp] += 1
    for count in counter[1:]:
        print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools
n = int(input())
dic = {}
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      f_xyz = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if f_xyz in dic:
        dic[f_xyz] += 1
      else:
        dic[f_xyz] = 1
for i in range(1, n+1):
  if i in dic:
    print(dic[i])
  else:
    print(0)

Submission status: Accepted

Solution code:
def main():
    num = int(input())
    counter = [0] * (num + 1)
    # func(41, 41, 41) = 10086
    # func(99, 1, 1) = 10002
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 123 - x - y + 1):
                tmp = (x + y + z) ** 2 - x * y - y * z - z * x
                if tmp <= num:
                    counter[tmp] += 1
    for count in counter[1:]:
        print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

MX = 10**4
ans = {}
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+x*z+y*z

            if not(tmp in ans):
                ans[tmp] = 1
            else:
                ans[tmp] += 1

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

Submission status: Accepted

Solution code:
N = int(input())

MX = 10**4
ans = {}
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+x*z+y*z
            if tmp > MX:
                break
            if not(tmp in ans):
                ans[tmp] = 1
            else:
                ans[tmp] += 1

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

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

for x in range(1,700):
    for y in range(1,700):
        for z in range(1,701):
            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:
# Coding is about expressing your feeling, and
# there is always a better way to express your feeling_feelme
import sys
import math
# sys.stdin=open('input.txt','r')
# sys.stdout=open('output2.txt','w')
from sys import stdin,stdout
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007


n=ii1()
ans=[0]*(n+1)
for i in range(1,102):
    for j in range(1,102):
        for k in range(1,102):
            res=i*i + j*j +k*k +i*j +j*k + k*i
            if res<n+1:
                ans[res]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import math
n=int(input())
j=int(math.sqrt(n))
k=[0]*n
for x in range(1,j+1):
     for y in range(1,j+1):
        for z in range(1,j+1):
            p=x**2+y**2+z**2+x*y+y*z+z*x
            if p<=n:
                k[p-1]+=1
[print(i)for i in k]

Submission status: Accepted

Solution code:
"""
(x+y+z)^2 = (x^2+y^2+z^2) + 2(xy+yz+zx)
"""
def func(x, y, z): return (x + y + z) ** 2 - x * y - y * z - z * x


def main():
    num = int(input())
    counter = [0] * (num + 1)
    # func(41, 41, 41) = 10086
    # func(99, 1, 1) = 10002
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 123 - x - y + 1):
                if (tmp := func(x, y, z)) <= num:
                    counter[tmp] += 1
    for count in counter[1:]:
        print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
def main():
    N = int(input())
    n = int(math.sqrt(N)) + 1
    ans = [0]*10001
    for x in range(1,n):
        for y in range(1,n):
            for z in range(1,n):
                v = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if v <= 10000:
                    ans[v] += 1 
    for i in range(1,N+1):
        print(ans[i])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
end=int(n**0.5)+1
cnt=0
l=[0 for i in range(6*end*end)]
for i in range(1,end):
  for j in range(1,end):
    for k in range(1,end):
      now=i*i+j*j+k*k+i*j+i*k+j*k
      l[now-1]+=1
for i in range(n):
  print(l[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
res = [0]*10001

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if tmp <= 10000:
                res[tmp] += 1

N = int(input())

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    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):
                x = i*i + j*j + k*k + i*j + j*k + k*i 
                if x <= N:
                    ans[x] += 1
    for i in range(1,N + 1):
        print(ans[i])
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import product
N = int(input())
cnt = [0 for _ in range(N+1)]
for x, y, z in product(range(1, 101), repeat=3):
    if x*x+y*y+z*z+x*y+y*z+z*x <= N:
  	  cnt[x*x+y*y+z*z+x*y+y*z+z*x] += 1

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

Submission status: Accepted

Solution code:
import math

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

for x in range(1,750):
    for y in range(1,750):
        for z in range(1,750):
            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 math

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

for x in range(1,500):
    for y in range(1,500):
        for z in range(1,501):
            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 math

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

for x in range(1,300):
    for y in range(1,300):
        for z in range(1,301):
            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 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:
n = int(input())

lst = [0]*n
a = int(n ** 0.5)

for x in range(1, a):
    for y in range(1, a):
        for z in range(1, a):
            b = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if b > n:
                continue
            else:
                lst[b - 1] += 1

for i in lst:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [0]*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:
                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 x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x * x + y * y + z * z + x * y + y * z + z * x
            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]*10800
for x in range(1,108):
  for y in range(1,108):
    for z in range(1,108):
      v=x*x+y*y+z*z+x*y+y*z+z*x
      if 0<=v<10800:
        ans[v]+=1
for i in range(1,n+1):
  print(ans[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())
a = [0]*n
cnt = 0
for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      b = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if b <= n:
        a[b-1] += 1

for i in a:
  print(i)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
import math

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	f = lambda x, y, z: x**2 + y**2 + z ** 2 + x*y + y*z + z*x
	vals = defaultdict(lambda: 0)
	for x in range(1, 120):
		for y in range(1, 120):
			for z in range(1, 120):
				cand = f(x,y,z)
				if cand > n: break
				vals[cand] += 1
	for i in range(1, n+1):
		print(vals[i])
	stdout.close()

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n=int(input())

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

for count in countlist:
    print(count)