Switch everything to base 2 and base 3. Let L2=log2 and L3=log3.
log24=log(23⋅3)=3L2+L3
log18=log(2⋅32)=L2+2L3
p=L2+2L33L2+L3
Similarly:
log108=log(22⋅33)=2L2+3L3
log96=log(25⋅3)=5L2+L3
log96108=5L2+L32L2+3L3
Let t=L3L2. Divide top and bottom of each fraction by L3:
p=t+23t+1, which gives t=3−p2p−1
Substitute into the target expression:
log96108=5t+12t+3
Numerator =3−p2(2p−1)+3=3−p4p−2+9−3p=3−pp+7
Denominator =3−p5(2p−1)+1=3−p10p−5+3−p=3−p9p−2
The (3−p) cancels:
log96108=9p−2p+7
Answer =9p−2p+7