Scanf.scanf "%d" (fun n ->
    let sq = int_of_float (sqrt (float n)) in

    let a = Array.make (n + 1) 0 in

    for x = 1 to sq do
        for y = 1 to sq do
            for z = 1 to sq do
                let v = x * x + y * y + z * z + x * y + y * z + z * x in
                if v <= n then a.(v) <- a.(v) + 1
            done
        done
    done;
    for i = 1 to n do
        Printf.printf "%d\n" a.(i)
    done
)