A legacy is divided among 5 brothers, the first person gets half of the inheritance plus 1 dollar, the second person gets the remaining half plus 2 dollars, the third person gets the remaining half plus 3 dollars, the fourth One person gets the remaining half plus $4, and the fifth person gets $500. How much is the inheritance?
一笔遗产分给5个兄弟，第一个人得到遗产的一半再加上1美元，第二个人得到余下的一半再加2美元，第三个人得到再余下的一半再加3美元，第四个人得到再余下的一半再加4美元，第五个人得到500美元，这笔遗产一共有多少？
<gadget id="calculator">500 + 4</gadget>
<output>504</output>

<gadget id="calculator">504 * 2</gadget>
<output>1_008</output>

<gadget id="calculator">1_008 + 2</gadget>
<output>1_010</output>

<gadget id="calculator">1_010 * 2</gadget>
<output>2_020</output>

<gadget id="calculator">2_020 + 2</gadget>
<output>2_022</output>

<gadget id="calculator">2_022 * 2</gadget>
<output>4_044</output>

<gadget id="calculator">4_044 + 1</gadget>
<output>4_045</output>

<gadget id="calculator">4_045 * 2</gadget>
<output>8_090</output>

<result>8_090</result>