# Winston the Hobo

Winston the Hobo really loves smoking. Every $7$ cigarette butts he finds on the ground, he rolls the tobacco in a cigarette and smokes it.

Winston is very poor, so he actually rolls cigarettes with his own butts. For instance, if he finds $49$ butts, he'll smoke $7+1$ cigarettes: $7$ from the butts he found, and $1$ rolled from the butts of the cigarettes he smoked.

How many cigarettes does Winston smoke after he finds $n$ butts?

Addendum: the function $f(n)$ must not make use of the floor function.

• Why don't you post your answer that does not involve the floor function? (I'm guessing that instead of $\lfloor \frac{n-1}{6} \rfloor$ you have something in mind like: "if $6m \le n - 1 < 6m + 6$, then the answer is $m$". Or "the answer is $((n-1) - ((n-1) \bmod 6)) / 6$". All of which are equivalent.) Nov 28 '16 at 18:52

(Very similar questions have been asked and answered here before: A Fairly Simple Riddle and The Chain Smokers. This is different in that it asks for an answer for arbitrary $n$.)
Let's generalize a bit more and say that Winston can make a cigarette from $k$ butts.
Every time Winston makes a cigarette and smokes it, he reduces the number of butts by $k-1$. He can do this as long as there are at least $k$ butts; that is, as long as he ends up with at least one butt. So we can hide one of the butts and say that he just repeatedly turns $k-1$ butts to no butts (making a cigarette each time) until none remain. Therefore the number of cigarettes he makes is $\left\lfloor\frac{n-1}{k-1}\right\rfloor$.
• This is not my point. I am saying that the case for this particolar $k$ does not require the use of floor function or equivalent forms. Nov 24 '16 at 13:30