cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A225575 Primes p such that if q is the next prime after p then the concatenation of p with q and the concatenation of q with p are both primes.

Original entry on oeis.org

199, 233, 257, 353, 523, 653, 971, 1973, 2333, 3259, 3637, 3761, 4283, 4993, 5927, 6353, 6529, 6563, 7907, 8831, 9293, 9851, 10711, 10861, 11731, 13037, 13177, 13681, 15241, 16381, 16693, 16931, 18341, 18899, 19577, 21787, 23857, 24071, 28621, 31657, 32911
Offset: 1

Views

Author

W. Edwin Clark, May 10 2013

Keywords

Comments

This sequence was suggested by Puzzle 687 at Prime Puzzles (see Links).
If q = p + 2 (that is, p is the lesser of a twin prime, A001359), then p is not in the sequence. - Alonso del Arte, May 10 2013
In general, q-p == 0 (mod 6). - Zak Seidov, May 11 2013

Examples

			The prime following 199 is 211 and both 199211 and 211199 are prime.
		

Crossrefs

Cf. A030459.

Programs

  • Magma
    conc:=func; [p:p in PrimesUpTo(17000)| IsPrime(conc(p,(NextPrime(p)))) and IsPrime(conc(NextPrime(p),p))]; // Marius A. Burtea, Jan 25 2020
  • Maple
    a:=NULL;
    for i from 1 to 2000 do
      p:=ithprime(i);
      q:=nextprime(p);
      s:=convert(p,string);
      t:=convert(q,string);
      if isprime(parse(cat(s,t))) and isprime(parse(cat(t,s))) then a:=a,p; fi;
    od:
    a;
  • Mathematica
    concatQ[{a_,b_}]:=Module[{idna=IntegerDigits[a],idnb=IntegerDigits[b]},AllTrue[ FromDigits/@ {Join[idna,idnb], Join[idnb,idna]},PrimeQ]]; Transpose[Select[ Partition[ Prime[Range[2000]],2,1],concatQ]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 16 2015 *)