Let $p(x)$ be defined on $2 \le x \le 10$ such that$$p(x) = \begin{cases} x + 1 &\quad \lfloor x \rfloor\text{ is prime} \\ p(y) + (x + 1 - \lfloor x \rfloor) &\quad \text{otherwise} \end{cases}$$where $y$ is the greatest prime factor of $\lfloor x\rfloor.$ Express the range of $p$ in interval notation.
So I put the answer as $[3,8]$ but it was wrong but I'm not sure why. Help!

HINT: study the behaviour of $p([n,n+1[)$ as $n$ ranges in the set $\Bbb{N}\cap [2,9]$.
EDIT: Observe first that in the interval $[n,n+1[$ the floor function takes only the value $n$ and the function $x-\lfloor x \rfloor$, that is the fractional part of $x$, is a bijection with the interval $[0,1[$. Then you can proceed like this: