TITLE: Find all $n$ such that each number containing $n$ $1$'s and one $3$ is prime
QUESTION [13 upvotes]: This question is O205 from the Mathematical Reflections.
I do not own any copyrights to this question.

Find all $n$ such that each number containing $n$ $1$'s and one $3$ is prime.

For example, when $n=2$ we find that $113, 131$ and $311$ are prime.

REPLY [2 votes]: $1...31 \ - \ 1...13=18\\
1...311 \ - \ 1...131=180\\
1...3111 \ - \ 1...1311=1800$
If $1...113\equiv x \mod 17$ then $1...131\equiv x+18 \mod 17\equiv x+1 \mod17$ and $1...311\equiv x+18+180 \mod 17\equiv x+11 \mod17$.
The first 50 terms in this sequence contain every possible residue$\mod 17$ therefore if none of the permutations is a multiple of $17$ then $n\leq 50$. I checked all $n$ up to $50$ and the only solutions I found were $0,1,2$.