Tip: Start small. If $n=1$, there are $4$ arrangements of length $n$, easily listed: $1$, $2$, $3$, $4$.
How many arrangements of length $2$ are there? Make an explicit listing of them, as follows. There is $1$, followed by anything, that is $11$, $12$, $13$, and $14$. That's $4$ arrangements. Then there is $2$, followed by anything. That's $4$ more. Then there is $3$, followed by anything, $4$ more. Finally, there is $4$, followed by anything. The total is $4+4+4+4=16$.
How many arrangements of length $3$? There are the ones of shape $1ab$, where $ab$ is any arrangement of length $2$. By the previous paragraph, there are $16$ of these. Then there are the ones of shape $2ab$, where $ab$ is any of the $16$ arrangements of length $2$, another $16$. And then there are the $3ab$, and the $4ab$, a total of $16+16+16+16=64$.
Continue. How many arrangements of length $4$? There are the ones of shape $1abc$, where $abc$ is any of the $64$ arrangements of length $3$. And the ones of shape $2abc$, $3abc$, $4abc$, a total of $64+64+64+64$.
Note that the number of arrangements of length $n+1$ is, by the same argument, $4$ times the number of arrangements of length $n$. Now you should be able to find a compact general formula.
Remark: The description "at most $n$ values" is unfortunately imprecise. My interpretation was based on the examples in the post, and is not necessarily the one that you intend.
If you mean that arranements of any length $\le n$ are allowed, then one would add together the number of arrangements of length $1$, of length $2$, and so on up to length $n$. By the argument above, this sum is $4+4^2+5^3+\cdots +4^n$, which is a geometric series. There is a "closed form" formula for this sum.
There are other possible interpretations, for example the one in which we allow any string, with the only restriction being that there are at most $n$ occurrences of $1$, at most $n$ occurrences of $2$, and so on. That version is potentially more difficult to get a simple expression for.