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.

Showing 1-1 of 1 results.

A158962 a(n) is the smallest number m such that all n numbers m-1, m.m-1, ..., m.m. .. .m-1 are prime, where dot means concatenation.

Original entry on oeis.org

3, 4, 4, 444, 827868, 10387692, 1885781034
Offset: 1

Views

Author

Farideh Firoozbakht, Apr 02 2009

Keywords

Examples

			All 4 numbers 444-1,444444-1,1+444444444-1,444444444444-1 are prime and 444
is the smallest such number so a(4)=444.
		

Crossrefs

Cf. A153434.

Programs

  • Maple
    a:= proc(n) local m; for m do if andmap(isprime,
          [seq(parse(cat(m$i))-1, i=1..n)]) then return m fi od
        end:
    seq(a(n), n=1..5);  # Alois P. Heinz, Apr 14 2021
  • Python
    from sympy import isprime
    def A158962(n):
        m = 1
        while True:
            for i in range(n):
                if not isprime(int(str(m)*(i+1))-1):
                    break
            else:
                return m
            m += 1 # Chai Wah Wu, Apr 14 2021
Showing 1-1 of 1 results.