Hilbert function and numerical invariants of closed subschemes of P^n