Some (two) useful formulas that I cannot find on the internet

Mind you, arrays in C are zero based.