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.

A228325 a(n) is the smallest number m>n such that the concatenation nm is prime.

Original entry on oeis.org

3, 3, 7, 7, 9, 7, 9, 9, 11, 13, 17, 13, 19, 23, 23, 19, 21, 23, 31, 27, 29, 37, 33, 37, 31, 33, 29, 33, 39, 37, 37, 51, 43, 49, 39, 37, 39, 47, 43, 49, 53, 43, 49, 47, 47, 49, 51, 61, 51, 51, 53, 61, 81, 71, 57, 57, 79, 61, 81, 67, 63, 63, 67, 69, 69, 73, 79
Offset: 1

Views

Author

N. J. A. Sloane, Aug 20 2013

Keywords

Comments

Max Alekseyev (see link in A068695) shows that a(n) always exists. - N. J. A. Sloane, Nov 13 2020
Suggested by the existence question in A228323.

Examples

			12 is not prime but 13 is, so a(1)=3.
23 is prime so a(2)=3.
34, 35, 36 are not prime but 37 is, so a(3)=7.
		

Crossrefs

Programs

  • Mathematica
    smc[n_]:=Module[{m=n+1},If[OddQ[n],m++];While[!PrimeQ[n*10^IntegerLength[ m]+ m],m=m+2];m]; Array[smc,70] (* Harvey P. Dale, Apr 30 2016 *)
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(n+1) if isprime(int(str(n)+str(k))))
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Oct 18 2022