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.

A053583 a(n+1) is the smallest prime ending with (but not equal to) a(n), where a(1)=3.

Original entry on oeis.org

3, 13, 113, 2113, 12113, 612113, 11612113, 1611612113, 111611612113, 1111611612113, 81111611612113, 2181111611612113, 132181111611612113, 11132181111611612113, 3411132181111611612113, 413411132181111611612113, 12413411132181111611612113
Offset: 1

Views

Author

G. L. Honaker, Jr., Jan 18 2000

Keywords

Crossrefs

Programs

  • Maple
    A[1]:= 3;
    for n from 2 to 100 do
    d:= 10^(ilog10(A[n-1])+1);
    for k from 1 do
      p:= A[n-1]+d*k;
      if isprime(p) then
        A[n]:= p;
        break
      fi
    od
    od:
    seq(A[n],n=1..100); # Robert Israel, Jul 15 2014
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(an=3):
        while True:
            yield an
            pow10 = 10**len(str(an))
            for t in count(pow10+an, step=pow10):
                if isprime(t):
                    an = t
                    break
    print(list(islice(agen(), 17))) # Michael S. Branicky, Jun 23 2022

Extensions

Definition corrected by Robert Israel, Jul 15 2014