Biomimetic compounds containing hydroxyapatites substituted with magnesium and carbonate, and the processes used to obtain them