For the amount invested in the 20 year annuity immediate,
the return will be;
r/(1 - (1+r)^-n) = 0.05/(1- 1.05^-20)
= 0.0802425872
= 8.02425872%
Now, return on perpetuity-immediate = 5%
So, 5% + 8.02425872% = 13.02425872
for equal returns from both investments,
X = 5/(13.02425872) x 640,000
= $245,695.365
= $ 245,695.36