login
Primes formed by concatenating n, n, n, n, and 1 for n = 1, 2, 3,....
2

%I #31 Oct 26 2024 04:57:42

%S 33331,99991,242424241,404040401,454545451,464646461,494949491,

%T 525252521,575757571,737373731,787878781,949494941,1021021021021,

%U 1081081081081,1091091091091,1211211211211,1291291291291,1481481481481,1511511511511

%N Primes formed by concatenating n, n, n, n, and 1 for n = 1, 2, 3,....

%C This is to four (duplicated strings concatenated) as A210712 is to three (duplicated strings concatenated), and as A210511 is to two (duplicated strings concatenated).

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

%e a(1) = 33331 because Concat(3,3,3,1) = 3331 which is in A000040.

%p A210720 := proc(n)

%p local p;

%p [n,n,n,n,1] ;

%p p := digcatL(%) ;

%p if isprime(p) then

%p printf("%d,",p) ;

%p end if;

%p end proc:

%p for n from 1 to 400 do

%p A210720(n) ;

%p end do: # _R. J. Mathar_, Feb 10 2013

%t Select[Table[FromDigits[Flatten[{IntegerDigits[n], IntegerDigits[n], IntegerDigits[n], IntegerDigits[n], IntegerDigits[1], {}}]], {n, 200}], PrimeQ] (* _Vincenzo Librandi_, Mar 15 2013 *)

%t Select[Table[FromDigits[Join[Flatten[IntegerDigits/@PadRight[{},4,n]],{1}]],{n,200}],PrimeQ] (* _Harvey P. Dale_, Oct 16 2017 *)

%o (Magma) [nnnn1: n in [1..200] | IsPrime(nnnn1) where nnnn1 is Seqint([1] cat Intseq(n) cat Intseq(n) cat Intseq(n) cat Intseq(n))]; // _Vincenzo Librandi_, Mar 15 2013

%Y Cf. A210511, A210712.

%K nonn,base,easy

%O 1,1

%A _Jonathan Vos Post_, Jan 29 2013