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.

Previous Showing 21-21 of 21 results.

A236672 Start with 9; thereafter, primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime.

Original entry on oeis.org

9, 97, 971, 9719, 971917, 97191713, 9719171333, 971917133323, 9719171333237, 971917133323777, 97191713332377731, 9719171333237773159, 971917133323777315951, 97191713332377731595127, 971917133323777315951277, 971917133323777315951277269
Offset: 1

Views

Author

Derek Orr, Jan 29 2014

Keywords

Comments

a(n+1) is the next smallest prime beginning with a(n). Initial term is 9. After a(1), these are the primes in A069611.

Examples

			a(1) = 9 by definition.
a(2) is the next smallest prime beginning with 9, so a(2) = 97.
a(3) is the next smallest prime beginning with 97, so a(3) = 971.
		

Crossrefs

Programs

  • Maple
    R:= 9: x:= 9:
    for i from 2 to 20 do
      for y from 1 by 2 do
        z:= x*10^(1+ilog10(y)) + y;
        if isprime(z) then
          R:= R,z; x:= z; break
        fi
    od od:
    R; # Robert Israel, Nov 22 2023
  • Mathematica
    next[p_]:=Module[{i=1,q},While[!PrimeQ[q=10^IntegerLength[i]p+i],i+=2];q];
    NestList[next,9,15] (* Paolo Xausa, Nov 23 2023 *)
  • Python
    import sympy
    from sympy import isprime
    def b(x):
      num = str(x)
      n = 1
      while n < 10**3:
        new_num = str(x) + str(n)
        if isprime(int(new_num)):
          print(int(new_num))
          x = new_num
          n = 1
        else:
          n += 1
    b(9)
Previous Showing 21-21 of 21 results.