
--{-# LANGUAGE StandaloneDeriving #-}
--{-# LANGUAGE BangPatterns #-}

module Main where

import Debug.Trace
import Control.Monad
import Data.List
--import Data.Char
--import qualified Data.Set as Set
--import qualified Data.Map.Strict as Map

main :: IO ()
main = do
  a <- read <$> getLine
  --a `traceShow`
  forM_ [1..a] $ \i -> do
    print $ solve i

solve :: Int -> Int
solve i = sum ans
  where
    cand = [(x, y, z) | x <- [1..i], x * x <= i, y <- [x..i], y * y <= i, z <- [y..i], z * z <= i, check i x y z]
    ans = map parse cand

val :: Int -> Int -> Int -> Int
val x y z = x * x + y * y + z * z + x * y + y * z + z * x

check :: Int -> Int -> Int -> Int -> Bool
check i x y z = i == val x y z

parse :: (Int, Int, Int) -> Int
parse (x, y, z) = case length . group . sort $ [x, y, z] of
   1 -> 1
   2 -> 3
   3 -> 6
