[Combinatorics]
Problem: $\quad$ Let $S$ be the set of four-digit positive integers for which the sum of the squares of their digits is 17 . For example, $2023 \in S$ because $2^{2}+0^{2}+2^{2}+3^{2}=17$. Compute the median of $S$.

Solution: In order for the sums of the squares of four digits to be 17 , the digits must be either $0,2,2$, and 3 , or $0,0,1$, and 4 , in some order. If the leading digit is 2 , there are $3 !=6$ possible four-digit numbers. If the leading digit is 1,3 , or 4 , there are $\frac{3 !}{2 !}=3$ possible four-digit numbers. In total, there are $6+3 \cdot 3=15$ four-digit integers in $S$, and the median will be the eighth least. The least eight integers in $S$, from least to greatest, are: 1004, 1040, 1400, 2023, 2032, 2203, 2230, 2302. Thus the median of $S$ is 2302.

Final answer: 2302