login
Primes of the form: (concatenation of first n positive integers) + 1.
2

%I #20 Sep 08 2022 08:46:07

%S 2,13,123457,123456789101112131415161718192021222324252627282931

%N Primes of the form: (concatenation of first n positive integers) + 1.

%C a(5) = 123...868788+1 (a 167-digit number). - _Jon E. Schoenfield_, Apr 26 2014

%H Jinyuan Wang, <a href="/A241569/b241569.txt">Table of n, a(n) for n = 1..5</a>

%e 123457 is in sequence because 123456+1 = 123457 is prime.

%t Select[Table[FromDigits[Flatten[IntegerDigits[Range[n]]]] + 1, {n, 1, 1000}], PrimeQ] (* _Bruno Berselli_, Apr 27 2014 *)

%o (Magma) c:=0; for d in [1..3] do m:=10^d; for n in [m div 10..m-1] do c:=c*m+n; t:=c+1; if IsPrime(t) then t; end if; end for; end for; // _Jon E. Schoenfield_, Apr 26 2014

%o (Magma) [t+1: n in [1..1000] | IsPrime(t+1) where t is Seqint(Reverse(&cat[Reverse(Intseq(k)): k in [1..n]]))]; // _Bruno Berselli_, Apr 27 2014

%Y Cf. A241570.

%K nonn,base

%O 1,1

%A _Vincenzo Librandi_, Apr 26 2014