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.

A185949 Smallest prime ending in 10^n+1 in its base-10 representation.

Original entry on oeis.org

11, 101, 21001, 1810001, 2100001, 61000001, 2010000001, 11100000001, 61000000001, 1810000000001, 14100000000001, 151000000000001, 5010000000000001, 9100000000000001, 271000000000000001, 1110000000000000001, 24100000000000000001, 261000000000000000001, 3910000000000000000001, 11100000000000000000001
Offset: 1

Views

Author

Amir H. Farrahi, Feb 07 2011

Keywords

Programs

  • Maple
    f:= proc(n) local p;
      for p from 10^n+1 by 10^(n+1) do
        if isprime(p) then return p fi
      od
    end proc:
    map(f, [$1..30]); # Robert Israel, May 03 2018
  • Mathematica
    Table[k=0; While[!PrimeQ[p=FromDigits[Join[IntegerDigits[k], IntegerDigits[10^n+1]]]], k++]; p, {n,20}]
  • Python
    from sympy import isprime as is_prime
    # This implementation assumes function is_prime(n)
    # returns True if n is prime, or False otherwise:
    for n in range (1, 100):
        pattern = 10**n + 1
        for j in range (0, 10000000):
            if (j == 0):
                num = "%d" % (pattern)
            else:
                num = "%d%d" % (j, pattern)
            if (is_prime(int(num))):
                print(num)
                break