import Control.Monad
import Data.Function
import Data.Char
import Data.List
import Text.Read
import Text.ParserCombinators.ReadPrec

import Data.Array as A
import Data.Array.MArray as A
import Data.Array.ST as A

newtype Pair a b = Pair { getPair :: (a, b) }

instance (Read a, Read b) => Read (Pair a b) where
  readPrec = Pair `dot` (,) <$> readPrec <* get <*> readPrec

instance (Show a, Show b) => Show (Pair a b) where
  show (Pair (a, b)) = show a ++ " " ++ show b

infixr 8 `dot`
dot :: (c -> d) -> (a -> b -> c) -> a -> b -> d
dot = ((.).(.))

main :: IO ()
main = do
  n <- readLn
  let f = solve n
  mapM_ print $ map (f A.!) [1..n]

solve :: Int -> A.Array Int Int
solve n = A.runSTArray $ do
  let m = ceiling $ sqrt $ fromIntegral n
  f <- A.newArray (1, n) 0
  forM_ ((,,) <$> [1..m] <*> [1..m] <*> [1..m]) $ \(x, y, z) -> do
    let i = x^2 + y^2 + z^2 + x*y + y*z + z*x
    when (i <= n) $ do
      f_i <-A.readArray f i
      A.writeArray f i (f_i + 1)
  return f 
