A numerical property of hilbert functions and lex segment ideals