Thanks Alex and Liliya for your attempts. Empirically it seems to be 2n-4 from the examples listed in the original post. However I am not satisfied until the problem can be formulated and solved. Cant seem to find a proof by induction. My gut feel tells me that it could have something to do with the range of the given number ie: <=4, <=16, <=64 <=256 and a div()/mod() in the resultant formula. But then I may be totally wrong.
For eg: if <=4 then seems to be 2*n-3
For 4<n<=16 seems to be 2n-4
So can we extend this?