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?
 A: 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)$
A: You are on the right path.. Just a small observation away from the solution. In case you don't get it, I am providing the solution below.
Answer:
The range is $\cup_{p \in S} [p+1, p+2)$ where S is the set of all prime numbers.
To see this, take two cases-

*

*[x] is prime: The largest prime factor would be the number itself. So the range is [p+1,p+2).

*[x] is not prime: [x] can be decomposed into ${p_1}^{a_1}{p_2}^{a_2}...{p_n}^{a_n}$ for this, the range is [$max(p_i)$+1,$max(p_i)$+2).

By 1. we get all [p+1,p+2), where p is prime, in our range. By 2., we remove the possibility of having any [n+1,n+2), where n is not prime, in our range.
Edit: I did not see the constraints put on x. Upon adding the constraints, the answer would include just the prime numbers less than 10. This makes the question kinda trivial though :/
