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.

A053547 Smallest prime starting with A000422(n).

Original entry on oeis.org

11, 211, 3217, 432121, 543217, 65432117, 76543217, 876543211, 9876543211, 1098765432101, 11109876543211, 12111098765432101, 1312111098765432139, 141312111098765432113, 15141312111098765432173
Offset: 1

Views

Author

Enoch Haga, Jan 16 2000

Keywords

Examples

			a(6)=65432117 is smallest prime beginning with the string 654321.
		

Crossrefs

Cf. A000422.

Programs

  • Mathematica
    Flatten[Select[Join[10 #+Range[1,9,2],100 #+Range[1,99,2]],PrimeQ,1]&/@ Table[FromDigits[Flatten[IntegerDigits/@Range[n,1,-1]]],{n,25}]] (* Harvey P. Dale, Nov 04 2011 *)
  • Python
    from sympy import isprime
    def A053547(n):
        s = int(''.join(str(m) for m in range(n,0,-1)))
        for i in range(1,10):
            s *= 10
            for j in range(1,10**i,2):
                x = s+j
                if isprime(x):
                    return x
        else:
            return 'search limit reached.' # Chai Wah Wu, Jan 02 2015