HgBa2Ca3Cu4O10+δ and HgBa2Ca4Cu5O12+δ were prepared by high pressure/high temperature technique. The phase composition in the Hg-Ba-Ca-Cu-O system was shown to be very sensitive to synthesis conditions. A variation of the oxygen content in the starting oxide mixture by changing the BaO/BaO2 ratio allowed the acquisition of Hg-1234 and Hg-1245 in the overdoped state. The heat treatments (nitrogen and oxygen flows, oxygen pressure 100 bar and 2000 bar) resulted in a change of Tcs from initial overdoped (116 and 100 K for Hg-1234 and Hg-1245, respectively) to underdoped (95 and 85 K) and, finally, to optimally-doped states (125 and 111 K). The dependencies of Tc vs. a-parameter (and, consequently, oxygen content) for these phases exhibit a cupola-shaped behavior, as it was previously found for the lower (n ≤ 3) members of the HgBa2Can-1CunO2n+2+δ series.