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.

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

Original entry on oeis.org

3, 9, 37, 39, 51, 63, 87, 89, 111, 117, 123, 153, 157, 163, 173, 177, 183, 207, 211, 213, 217, 219, 239, 249, 257, 263, 267, 269, 273, 277, 279, 289, 321, 323, 327, 333, 337, 339, 343, 359, 369, 379, 407, 423, 439, 441, 459, 471, 473, 477, 479, 489, 497, 513
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Since there are primes in the sequence, and concat(p,p) = p*(10^x+1) is always composite, it is clear that here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015

Examples

			n=333 -> previous prime is 331, thus '331333' is a prime.
		

Crossrefs

Programs

  • Mathematica
    coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n,-1],n}]]]]; Select[Range[3,513],coQ[#]&] (* Jayanta Basu, May 30 2013 *)
    Select[Range[2,550],PrimeQ[NextPrime[#,-1]*10^IntegerLength[#]+#]&] (* Harvey P. Dale, Nov 22 2020 *)
  • PARI
    isok(n)=n>2 && isprime(fromdigits(concat(digits(precprime(n-1)), digits(n)))) \\ Andrew Howroyd, Aug 13 2024
  • Python
    from sympy import isprime, prevprime
    def aupto(m):
      return [k for k in range(3, m+1) if isprime(int(str(prevprime(k))+str(k)))]
    print(aupto(513)) # Michael S. Branicky, Mar 09 2021
    

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024