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.

A034812 Concatenation of 'prevprime(k) and k and prevprime(k)' is a prime.

Original entry on oeis.org

5, 8, 9, 12, 14, 17, 19, 23, 25, 28, 31, 33, 38, 39, 41, 42, 47, 48, 51, 60, 61, 62, 63, 69, 71, 72, 75, 77, 78, 80, 81, 84, 85, 91, 102, 104, 105, 111, 124, 126, 149, 150, 167, 181, 182, 189, 192, 194, 215, 222, 227, 230, 233, 242, 243, 256, 271, 273, 283, 288, 308
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			n=222 -> previous prime is 211, thus '211222211' is a prime.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_] := Module[{idppn=IntegerDigits[NextPrime[n,-1]]}, PrimeQ[FromDigits[Join[idppn, IntegerDigits[n], idppn]]]]; Select[Range[350], okQ] (* Harvey P. Dale, Jan 07 2011 *)
  • PARI
    isok(n)=my(x=digits(precprime(n-1))); n>2 && isprime(fromdigits(concat([x, digits(n), x]))) \\ Andrew Howroyd, Aug 13 2024

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024