login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Primes formed by concatenating k, k, and 1 for k >= 1.
8

%I #36 Jul 26 2022 21:59:03

%S 331,661,881,991,18181,20201,21211,26261,27271,32321,33331,41411,

%T 48481,51511,54541,57571,60601,65651,69691,71711,78781,86861,89891,

%U 90901,92921,98981,99991,1041041,1051051,1131131,1191191,1201201,1221221,1231231,1261261,1281281

%N Primes formed by concatenating k, k, and 1 for k >= 1.

%C This sequence is similar to A030458 and A052089.

%H Vincenzo Librandi, <a href="/A210511/b210511.txt">Table of n, a(n) for n = 1..1000</a>

%t Select[Table[FromDigits[Flatten[{IntegerDigits[n], IntegerDigits[n], {1}}]], {n, 100}], PrimeQ] (* _Alonso del Arte_, Jan 27 2013 *)

%t With[{nn=200},Select[FromDigits[Flatten[IntegerDigits[#]]]&/@Thread[ {Range[ nn],Range[nn],1}],PrimeQ]] (* _Harvey P. Dale_, Aug 17 2013 *)

%o (Python)

%o import numpy as np

%o def factors(n):

%o return reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))

%o for i in range(1,2000):

%o p1=int(str(i)+str(i)+"1")

%o if len(factors(p1))<3:

%o print(p1)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice

%o def agen(): yield from filter(isprime, (int(str(k)+str(k)+'1') for k in count(1)))

%o print(list(islice(agen(), 36))) # _Michael S. Branicky_, Jul 26 2022

%o (Magma) [nn1: n in [1..130] | IsPrime(nn1) where nn1 is Seqint([1] cat Intseq(n) cat Intseq(n))]; // _Bruno Berselli_, Jan 30 2013

%Y Cf. A030458, A052089.

%K nonn,easy,base

%O 1,1

%A _Abhiram R Devesh_, Jan 26 2013