EDIT: My original answer was incorrect even with the interpretation I had in mind. Here is the correction.
I originally gave a formula for the number of ways to pick $K$ numbers so that the maximum is at most $R$, rather than exactly $R$. Moreover, I interpreted the question as asking for the number of different selections, so that if you first picked $1$ and then $2$, this was the same "pick" as first picking $2$ and then $1$.
If we interpret it that way, so that we are asking for different multisets of choices, then we are asking about combinations with repetitions.
The number of ways of choosing $r$ objects from among $n$ objects with replacement is $\binom{n+r-1}{r}$.
So the number of ways to pick $K$ from among the $R$ that are less than or equal to $R$ is $\binom{R+K-1}{K}$. However, some of them will not include the number $R$; how many? Well, $\binom{(R-1)+K-1}{K}=\binom{R-K-2}{K}$, since these are the number of choices from among the first $R-1$ instead. Thus, the total with this interpretation is:
\begin{equation*}
\binom{R+K-1}{K} - \binom{R+K-2}{K} = \binom{R+K-2}{K-1}.
\end{equation*}
Alternatively, reserve one spot for for $R$, and then pick the remaining $K-1$ any way you want from among the first $R$.
However, the explanation posted tells us that in fact they are thinking of the order of the choices as important: so picking $1$ first and $2$ second is different from picking $2$ first and $1$ second.
In that case, we can pick any of the first $R$ numbers at each step, $K$ steps, so that gives $R^K$ choices. In some of them we never picked $R$, however; how many? Well, if we can only pick from among $1,\ldots,R-1$, then by the same argument we have $(R-1)^K$ possibilities. So the total is
$R^K - (R-1)^K$ as explained there.
Added: Since, as you say, you've never seen the formula for combinations with repetitions, and since it is dear to my heart (I figured it out from scratch during my first semester, when considering the question of how many different rolls with $n$ $r$-sided dice there are by constructing a big table, eventually recognizing it as Pascal's Triangle on its side, then using the combinatorial formula for the entry to get the formula, and finally coming up with a proof of it) (and that was probably more than you needed to know) here goes:
Suppose you have $n$ elements; without loss of generality, assume they are the numbers $1$ through $n$. Now, we want to pick $r$ elements form them with repetitions, so we will have $b_1,\ldots,b_r$. Order them so that $b_1\leq b_2\leq\cdots\leq b_r$. Now consider the vector $(b_1,b_2+1,b_3+2,\ldots,b_{r}+r-1)$. Then the entries of these vector are all distinct, and each entry is a number between $1$ and $n+r-1$. Different choices lead to different vectors, so the number of possible choices with repetitions is at most the number of ways to pick $r$ objects from $n+r-1$ possibilities without repetition.
Conversely, suppose you pick $r$ numbers from among $1,2,\ldots,n+r-1$ without repetition, $a_1,a_2,\ldots,a_r$. Order them so that $a_1\lt a_2\lt\cdots\lt a_r$. Then consider $(a_1, a_2-1, a_3-2,\ldots,a_r-r+1)$. Since $a_i\geq i$, then $a_i-(i-1)\geq 1$, and $a_i\lt a_{i+1}$ so $a_i-i+1 \leq a_{i+1}-i$. Thus, this new vector corresponds, as before, to a choice of $r$ numbers from among $1,2,\ldots,n$ with repetitions allowed. Different choices lead to different vectors, so the number of possible ways to pick $r$ objects from $n+r-1$ possibilities without repetition is at most the number of ways to pick $r$ objects from among $n$ possibilities with repetions.
Thus, the two quantities are equal. Since the number of ways to pick $r$ objects from among $n+r-1$ possibilities without repetition is $\binom{n+r-1}{r}$, the formula follows.
(When I proved it to myself, I took my original set and added symbols "R1", "R2",$\ldots$,R(r-1), which stood for "repeat position 1", "repeat position 2", etc. Then I picked from among $1,2,\ldots,n$,R1,R2,$\ldots$,R(r-1) without repetition, and wrote them in order, with $1\lt 2\lt\cdots\lt n\lt$ R1$\lt\cdots\lt$ R(r-1); this then gave me a "pick with repetitions".)