05AB1E, 19 1818 17 bytes
[Ð17SØså#pi·<ëDfθ[ÐƵηfså#pi·<ëDfθ- Explanation
[ # # loop until Ð så # a copy of the current value is contained in 17SØƵηf # the list of primes withunique indicesprime 1factors andof 7171 pi # if the current value is prime ·< # double and decrement ë - # else subtract Dfθ # the largest prime factor of a copy of the current value