login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358421 Primes that are the concatenation of two primes with the same number of digits. 3

%I #25 Feb 28 2023 14:21:28

%S 23,37,53,73,1117,1123,1129,1153,1171,1319,1361,1367,1373,1723,1741,

%T 1747,1753,1759,1783,1789,1913,1931,1973,1979,1997,2311,2341,2347,

%U 2371,2383,2389,2917,2953,2971,3119,3137,3167,3719,3761,3767,3779,3797,4111,4129,4153,4159,4337,4373,4397,4723,4729

%N Primes that are the concatenation of two primes with the same number of digits.

%C It appears that there are ~ 0.81*100^k/(k^2 log^2 10) 2k-digit numbers in this sequence, making their relative density 0.9/(k^2 log^2 10) among 2k-digit numbers. Of course there are no 2k+1-digit terms in the sequence. - _Charles R Greathouse IV_, Nov 15 2022

%C The second Mathematica program below generates all 2-digit and 4-digit terms of the sequence. To generate all 2,753 6-digit terms of the sequence, use this Mathematica program: Select[1000#[[1]]+#[[2]]&/@Tuples[Prime[Range[26,168]],2],PrimeQ]. There are 112,649 8-digit terms of the sequence. - _Harvey P. Dale_, Feb 28 2023

%H Robert Israel, <a href="/A358421/b358421.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 1117 is a term because 11 and 17 are both 2-digit primes and 1117 is prime.

%p Res:= NULL: count:= 0:

%p for d from 2 by 2 while count < 100 do

%p pq:= 10^(d-1);

%p while count < 100 do

%p pq:= nextprime(pq);

%p if pq > 10^d then break fi;

%p q:= pq mod 10^(d/2);

%p if q < 10^(d/2-1) then next fi;

%p p:= (pq-q)/10^(d/2);

%p if isprime(p) and isprime(q) then Res:= Res,pq; count:= count+1 fi

%p od od:

%p Res;

%t Select[Prime[Range[640]], EvenQ[(s = IntegerLength[#])] && IntegerDigits[#][[s/2 + 1]] > 0 && And @@ PrimeQ[QuotientRemainder[#, 10^(s/2)]] &] (* _Amiram Eldar_, Nov 15 2022 *)

%t Join[Select[FromDigits/@Tuples[Prime[Range[4]],2],PrimeQ],Select[100#[[1]]+ #[[2]]&/@ Tuples[Prime[Range[5,25]],2],PrimeQ]] (* _Harvey P. Dale_, Feb 28 2023 *)

%o (Python)

%o from itertools import count, islice

%o from sympy import isprime, primerange

%o def agen(): # generator of terms

%o for d in count(1):

%o pow = 10**d

%o for p in primerange(10**(d-1), pow):

%o for q in primerange(10**(d-1), pow):

%o t = p*pow + q

%o if isprime(t): yield t

%o print(list(islice(agen(), 51))) # _Michael S. Branicky_, Nov 15 2022

%Y Subsequence of A000040 and of A001637.

%K nonn,base,easy

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Nov 15 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 12 11:39 EDT 2024. Contains 372478 sequences. (Running on oeis4.)