Hello,
we all know that 31,331,3331,33331,333331,3333331,33333331 all are primes, and that 333333331 is not. Here we prepend the digit 3 to 31, to get a list of 7 primes.This gives me the following thought:


Let 
 $$D = \{\text{all possible nonnull finite digit strings}\},$$
 $$D' = \{\text{all things in D that do not start with 0}\}.$$  

Define a function $m: D' \times D \to N \cup {\infty}$ by: 
 $$m(A,B)= \min \{ k\geq 1 \colon A^kB \text{ is composite} \} - 1,$$ 
i.e., the number of consecutive primes at the beginning of the list $AB, AAB, AAAB, \dots$. For example, $m(3,1)=7$.



> 
> Which values does $m$ take? Is it unbounded? Is it ever $\infty$?
> 
> 
> 


This question has been posted to math.stackexchange too, and I got one comment talking about that it might involve Tao-Ziegler extension to the Green-Tao theorem, and so I thought it might be more appropriate here. So please, excuse me if it's posted wrongly, or if one shouldn't post to both channels.



Prepending strings to primes.
Two comments:


(1) It is impossible that $m(A,B)= \infty$. The sequence you are interested in is $B$, $10^k A+B$, $(10^{2k}+10^k)A+B$, $(10^{2k}+10^{2k}+10^k)A+B$, etcetera. Let $p$ be a prime dividing $B$. We claim that there is some $n$ such that $p$ divides $(10^{nk}+\cdots +10^{2k}+10^k)A+B$. Proof: if $p=2$ or $5$ then this is true for any $n$. If $p$ does not divide $10^k-1$, then $p$ divides $(10^{(p-1)k}-1)\*10^k/(10^k-1)$ by Fermat's Little Theorem, so $p$ divides $(10^{(p-1)k} + \cdots + 10^k)A + B$. If $p$ divides $10^k-1$ then $10^{pk}+10^{(p-1)k}+\cdots + 10^k \equiv 1+1+\cdots+1 \equiv 0 \mod p$. So $p$ divides $(10^{pk}+10^{(p-1)k}+\cdots + 10^k )A+B$. In every case, we have found a non-prime member of the sequence.


(2) I don't see how to get arbitrarily many primes of this form out of Green-Tao or Tao-Ziegler. Given fixed $k$ and $\ell$, Green-Tao will tell you that there are $A$ and $B$ such that $B$, $10^k A+B$, $(10^{2k}+10^k)A+B$, ..., $(10^{\ell k} + \cdots + 10^{2k} + 10^k)A+B$ are all prime. But it won't guarantee that $A$ and $B$ are less than $10^k$. Tao-Ziegler guarantees that there is some base $R$ and some constant $R$ such that $B$, $R+B$, $R^2+R+B$, ..., $R^{\ell}+R^{\ell-1} + \cdots +R+B$ are all prime. So you can take $A=1$ if you are willing to work in bases other than $10$. But Tao-Ziegler doesn't guarantee that you can take $B<R$; the bounds in that paper go the other way, telling you that you can take $R=O(B^{\epsilon})$. 


