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.

A036937 Smallest n-digit prime containing only digits 2 and 3.

Original entry on oeis.org

2, 23, 223, 2333, 23333, 222323, 2222333, 22222223, 222323333, 2222232323, 22222222223, 222222333323, 2222222222323, 22222222223323, 222222222332233, 2222222222323223, 22222222222233323, 222222222222233323, 2222222222222233333, 22222222222222232233
Offset: 1

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Comments

It is conjectured that such a prime exists for every value of n.

Crossrefs

Programs

  • Mathematica
    Do[p = 2(10^n - 1)/9; k = 0; While[ ! PrimeQ[p], k++; p = FromDigits[ PadLeft[ IntegerDigits[k, 2], n] + 2]]; Print[p], {n, 1, 30}] (* Robert G. Wilson v, Apr 20 2002 *)
    Table[SelectFirst[FromDigits/@Tuples[{2,3},n],PrimeQ],{n,20}] (* Harvey P. Dale, Nov 07 2021 *)
  • Python
    from sympy import isprime
    from itertools import product
    def a(n):
      for b in product("01", repeat=n):
        m = int("".join(b).replace("0", "2").replace("1", "3"))
        if isprime(m): return m
      return None
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Feb 23 2021 after Robert G. Wilson v

Extensions

Edited by Jon E. Schoenfield, Mar 27 2014