login
Primes in which a string of 3's is sandwiched between two 1's.
9

%I #22 Jan 27 2023 13:34:41

%S 11,131,13331,1333331,

%T 13333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333331

%N Primes in which a string of 3's is sandwiched between two 1's.

%C a(5) consists of 93 and a(6) consists of 159 3's sandwiched between two 1's. - _Sascha Kurz_, Mar 26 2002

%C a(8) has 1471 digits. - _Michael S. Branicky_, Jan 27 2023

%H Michael S. Branicky, <a href="/A068645/b068645.txt">Table of n, a(n) for n = 1..7</a>

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/deplat.htm#pdp131">PDP Reference Table - 131</a>.

%H Makoto Kamada, <a href="https://stdkmd.net/nrr/1/13331.htm#prime">Prime numbers of the form 133...331</a>.

%H <a href="/index/Pri#Pri_rep">Index entries for primes involving repunits</a>.

%t Select[Flatten[Table[10*FromDigits[PadRight[{1},n,3]]+1,{n,120}]],PrimeQ] (* _Harvey P. Dale_, Aug 09 2020 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice

%o def agen(): yield from (t for i in count(0) if isprime(t:=int("1" + "3"*i + "1")))

%o print(list(islice(agen(), 7))) # _Michael S. Branicky_, Jan 27 2023

%Y Cf. A056244, A082697.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Feb 28 2002

%E More terms from _Sascha Kurz_, Mar 26 2002

%E Edited by _Ray Chandler_, Nov 04 2014