Answer: It would take 10.16 million years.
Explanation:
Light travels at a speed [tex]c=299 792 458\frac{m}{s}[/tex].
A light-year is the distance that light travels in vacuum in one year.
The Andromeda Galaxy is 2.54 million light-years from the Earth.
This means that
[tex]c\times(2.54million.years)=2.54million.light.years[/tex]
Let's say [tex]v[/tex] is the speed of the ship. Then
[tex]v=\frac{c}{4}[/tex] ⇒ [tex]c=4v[/tex]
So, we have:
[tex]4v\times(2.54million.years)=2.54million.light.years[/tex]
⇒ [tex]v\times4(2.54million.years)=2.54million.light.years[/tex]
⇒ [tex]v\times(10.16million.years)=2.54million.light.years[/tex]
So, at speed [tex]v[/tex], it would need a time of 10.16 million years.