Algebra - Piecewise Function 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.
I do not not where to start.
I know at $x \in [2, 3) $, the range is $[3, 4)$. Should I continue with this? Like continuing with $x\in [3,4)$, then $x \in [4, 5)$ and so on?

If $\lfloor x \rfloor \in \mathbb{P}$, then
$$ p(x) = x + 1 $$
So we cover the interval $[\lfloor x \rfloor + 1, \lfloor x \rfloor + 2)$
If $\lfloor x \rfloor \not\in \mathbb{P}$, then
$$ p(x) = p(y) + \{x\} + 1  = y + 2 + \{x\}$$
So we cover the interval $[y+2, y+3)$
The prime values of $\lfloor x \rfloor$ we take on in the domain are 2, 3, 5, 7.
So we cover the intervals [3, 4), [4, 5), [6, 7), [8, 9)
The non-prime values of $\lfloor x \rfloor$ are 4, 6, 8, 9 - they're largest prime factors are 2 and 3
So this lets us cover [4, 5) and [5, 6)
The union of all these intervals is [3, 7) union [8, 9)
We also have to consider the special case of $x = 10$, where p(10) = 6 + 1 = 7, which makes [3, 7) closed.
Therefore the range of p is $[3,7] \bigcup [8, 9)$
