Well, let's see.
Let the number be x.
We need
[tex]\frac{17-x}{23-x}=5/8[/tex]
Cross multiply:
[tex]8(17-x)=5(23-x)[/tex]
Expand:
[tex]136-8x=115-5x[/tex]
Simplify:
[tex]3x=126-115[/tex]
[tex]x=21/3=7[/tex]
Check:
[tex]\frac{17-7}{23-7}=\frac{10}{16}=\frac{5}{8}[/tex] ok