Consider numbers of the form $$ p=\underbrace{b\,\cdots\, b}_{n\,b\text{'s}}\,a\,\underbrace{b\,\cdots\, b}_{n\,b\text{'s}}, $$ where $0\leq a\leq 9$ and $1\leq b\leq 9$. In other words, $$ p=(a - b)10^n +\frac{b}{9}(10^{2 n - 1} - 1). $$ For example, $121,44344$ and $9990999$ are numbers of this form.
Given $a$ and $b$, for which values of $n$ is $p$ prime? Clearly, $p$ can only be prime if $b\in\{1,3,7,9\}$. What else can we say?
Letting $m=2n+1$ be the integer length of $p$, and just for fun, here are some of the values of $(a,b)$ and $m$ for which $p$ is a prime number (up to numbers of integer length $1000$) \begin{matrix} a&b&m\\ 0 & 1 & \{ 3 \}\\ 1 & 1 & \{ 9, 23, 317, 1031 \}\\ 2 & 1 & \{ \}\\ 3 & 1 & \{ 3, 5, 39, 195 \}\\ 4 & 1 & \{ 5, 7, 65, 91 \}\\ 5 & 1 & \{ 3, 15, 91, 231, 1363 \}\\ 6 & 1 & \{ 21, 29, 81, 119, 321, 825, 1121 \}\\ 7 & 1 & \{ 7, 67, 623 \}\\ 8 & 1 & \{ 3 , 9, 13, 15, 769, 1333, 1351 \}\\ 9 & 1 & \{ 3, 9, 53, 375, 453, 1749 \}\\ 0 & 3 & \{ \}\\ 1 & 3 & \{ 3, 7, 15, 123, 181, 185, 539, 597, 643, 743, 1553 \}\\ 2 & 3 & \{ \}\\ 4 & 3 & \{ \}\\ 5 & 3 & \{ 3, 5, 35, 159, 237, 325, 355, 371, 481, 1649 \}\\ 6 & 3 & \{ \}\\ 7 & 3 & \{ 3, 7, 15, 23, 27, 35, 59, 63, 67, 155, 1867 \}\\ 8 & 3 & \{ 3, 15, 171, 189, 547, 713 \}\\ 9 & 3 & \{ \}\\ 0 & 7 & \{ \}\\ 1 & 7 & \{ 233 \}\\ 2 & 7 & \{3, 7, 15, 21, 25, 961, 1899 \}\\ 3 & 7 & \{ 5 \}\\ 4 & 7 & \{ 5, 7, 13, 47, 73, 139, 1123, 1447 \}\\ 5 & 7 & \{ 3, 15, 27, 117, 259, 507 \}\\ 6 & 7 & \{ 9, 11, 17, 23 \}\\ 8 & 7 & \{ 3, 7, 79, 109, 337, 481 \}\\ 9 & 7 & \{ 3, 5, 17, 39, 41, 425, 561, 1775 \}\\ 0 & 9 & \{ \}\\ 1 & 9 & \{ 3, 11, 27, 87, 339, 363 \}\\ 2 & 9 & \{ 3, 17, 19, 705, 1061, 1395 \}\\ 3 & 9 & \{ \}\\ 4 & 9 & \{ 29, 45, 73, 209 \}\\ 5 & 9 & \{ 177, 225, 397, 1245 \}\\ 6 & 9 & \{ \}\\ 7 & 9 & \{ 237 \}\\ 8 & 9 & \{ 53, 757 \} \end{matrix} For example, for $a=4$ and $b=7$, $7777774777777$ is prime.
Naturally such answer entirely depends on the given pair $(a,b)$, but I wonder if something can be said about specific cases. For example, for which cases does $m$ take infinitely many values?
PS - If these type of primes are known, please suggest me a better name than the title.