Let $d,n\in \mathbb N$ and denote by $B_d(n)$ the set of all $d$-tuples $k\in\mathbb N^d$ such that
- all entries of $k$ are less than or equal to $n$ and
- at least one entry of $k$ is equal to $n$.
Is there a simple formula for the cardinality of $B_d(n)$?
I found that in the case $d=2$, the problem is rather simple and one has $|B_2(n)|=2n+1$, but I struggle to find any formula for the higher dimensional cases, although I'm sure there will be something similar.
All possible tuples are counted by $n^d,$ the restriction is that at least one has to be $n$ so take out all the tuples less or equal to $n-1$ that is $(n-1)^d$ so so have $$n^d-(n-1)^d$$