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!)
A309934 Primes p such that p+2, (p+1)||p and (p+1)||(p+2) are primes (where || denotes concatenation in base 10). 1

%I #16 Feb 17 2024 19:41:45

%S 41,101,107,179,191,269,311,419,521,659,821,881,1229,1481,4241,4787,

%T 8819,10331,11549,13691,14549,14561,14867,15731,17909,18521,20549,

%U 21647,22619,23669,23831,26261,27737,35837,38921,39041,40127,42017,43961,44531,46439,47711,48119,48821

%N Primes p such that p+2, (p+1)||p and (p+1)||(p+2) are primes (where || denotes concatenation in base 10).

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

%e a(3)=107 is in the sequence because 107, 109, 108107 and 108109 are primes.

%p Res:= {}:

%p for d from 1 to 6 do

%p P:= select(isprime,{seq(i,i=10^(d-1)+1..10^d,2)});

%p T:= P intersect map(`-`,P,2);

%p Res:= Res union select(p -> isprime((10^d+1)*p+10^d) and isprime((10^d+1)*p+10^d+2), T);

%p od:

%p sort(convert(Res,list));

%t cm[{a_,b_}]:=Module[{m=(a+b)/2,il},il=IntegerLength[m];AllTrue[m*10^il+{a,b},PrimeQ]]; Select[ Partition[Prime[Range[5100]],2,1],#[[2]]-#[[1]]==2&&cm[#]&][[;;,1]] (* _Harvey P. Dale_, Feb 17 2024 *)

%o (Magma) [p:p in PrimesUpTo(2200)|IsPrime(p+2) and IsPrime(Seqint(Intseq(p) cat Intseq(p+1))) and IsPrime(Seqint(Intseq(p+2) cat Intseq(p+1)))]; // _Marius A. Burtea_, Aug 23 2019

%o (PARI) isok(k) = isprime(k) && isprime(k+2) && isprime(eval(Str(k+1, k))) && isprime(eval(Str(k+1, k+2))); \\ _Jinyuan Wang_, Aug 26 2019

%Y Cf. A001359, A309935.

%K nonn,base

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Aug 23 2019

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 July 5 19:07 EDT 2024. Contains 374028 sequences. (Running on oeis4.)