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-7 of 7 results.

A110772 Beginning with 2, least number not occurring earlier such that every partial concatenation is prime.

Original entry on oeis.org

2, 3, 9, 11, 13, 63, 51, 29, 69, 33, 49, 159, 17, 37, 39, 117, 53, 43, 47, 31, 23, 97, 171, 89, 367, 347, 157, 83, 447, 19, 249, 153, 233, 163, 141, 317, 471, 391, 107, 93, 261, 339, 183, 87, 403, 129, 81, 173, 411, 57, 177, 109, 71, 121, 269, 609, 111, 1413, 99, 21
Offset: 1

Views

Author

Amarnath Murthy, Aug 12 2005

Keywords

Comments

Conjecture: every odd number not divisible by 5 is a member.

Examples

			2, 23, 239, 23911, 2391113, ... etc. are all prime.
		

Crossrefs

Programs

  • Maple
    L:=[2]: for n from 1 to 120 do for m from 1 do if isprime(parse(cat("",op(L),m))) and not member(m,L) then L:=[op(L),m]; break fi od od: L[]; # Alec Mihailovs, Aug 14 2005
  • Mathematica
    a[1]=2;a[n_]:=a[n]=Block[{t=1},While[!PrimeQ[FromDigits@Flatten[IntegerDigits/@Join[Array[a,n-1],{t}]]]||MemberQ[Array[a,n-1],t],t++];t];Array[a,60] (* Giorgos Kalogeropoulos, May 07 2023 *)
  • Python
    from gmpy2 import is_prime
    from itertools import count, islice
    def agen(): # generator of terms
        an, s, aset, mink = 2, "2", {2}, 3
        while True:
            yield an
            an = next(k for k in count(mink, 2) if k not in aset and is_prime(int(s+str(k))))
            s += str(an)
            aset.add(an)
            while mink in aset: mink += 2
    print(list(islice(agen(), 60))) # Michael S. Branicky, May 11 2023

Extensions

More terms from Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
Edited by Charles R Greathouse IV, Apr 27 2010

A236527 Primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime, starting with 3.

Original entry on oeis.org

3, 31, 311, 3119, 31193, 3119317, 31193171, 311931713, 3119317139, 311931713939, 31193171393933, 3119317139393353, 31193171393933531, 3119317139393353121, 311931713939335312127, 311931713939335312127113, 31193171393933531212711399, 31193171393933531212711399123
Offset: 1

Views

Author

Derek Orr, Jan 27 2014

Keywords

Comments

a(n + 1) is the next smallest prime beginning with a(n). Initial term is 3. These are the primes arising in A069605.

Examples

			a(1) = 3 by definition.
a(2) is the next smallest prime beginning with 3, so a(2) = 31.
a(3) is the next smallest prime beginning with 31, so a(3) = 311.
		

Crossrefs

Programs

  • Mathematica
    A069605[1] = 3; A236527[1] = 3; A069605[n_] := A069605[n] = Block[{k = 1, c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits[Flatten[Append[c, IntegerDigits[k]]]]], k += 2]; k]; A236527[n_] := A236527[n] = FromDigits[Flatten[IntegerDigits[A236527[n - 1]], IntegerDigits[A069605[n]]]]; Table[A236527[n], {n, 20}] (* Alonso del Arte, Jan 28 2014 based on Robert G. Wilson v's program for A069605 *)
    nxt[n_]:=Module[{s=1},While[CompositeQ[n*10^IntegerLength[s]+s],s+=2];n*10^IntegerLength[s]+s]; NestList[nxt,3,20] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 22 2020 *)
  • 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(3)

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)

A236528 Start with 4; 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

4, 41, 419, 41911, 4191119, 41911193, 419111933, 41911193341, 4191119334151, 419111933415151, 41911193341515187, 4191119334151518719, 419111933415151871963, 41911193341515187196323, 4191119334151518719632313, 419111933415151871963231329
Offset: 1

Views

Author

Derek Orr, Jan 27 2014

Keywords

Comments

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

Examples

			a(1) = 4 by definition.
a(2) is the next smallest prime beginning with 4, so a(2) = 41.
a(3) is the next smallest prime beginning with 41, so a(3) = 419.
...and so on.
		

Crossrefs

Programs

  • Mathematica
    NestList[Module[{k=1},While[!PrimeQ[#*10^IntegerLength[k]+k],k+=2];#*10^IntegerLength[k]+ k]&,4,20] (* Harvey P. Dale, Jul 20 2024 *)
  • 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(4)

A236529 Primes arising in A069607.

Original entry on oeis.org

5, 53, 5323, 53231, 532313, 5323139, 532313921, 5323139219, 532313921921, 53231392192123, 5323139219212343, 53231392192123433, 5323139219212343323, 53231392192123433237, 5323139219212343323721, 532313921921234332372189, 53231392192123433237218937, 5323139219212343323721893721
Offset: 1

Views

Author

Derek Orr, Jan 27 2014

Keywords

Comments

a(n+1) is the next smallest prime beginning with a(n). Initial term is 5.

Examples

			a(1) = 5.
a(2) is the next smallest prime that begins with 5, so a(2) = 53.
a(3) is the next smallest prime that begins with 53, so a(3) = 5323.
...and so on.
		

Crossrefs

Programs

  • 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(5)

A236670 Start with 6; 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

6, 61, 613, 6131, 613141, 61314119, 6131411917, 61314119171, 6131411917181, 613141191718127, 61314119171812789, 613141191718127893, 61314119171812789379, 6131411917181278937929, 61314119171812789379291, 61314119171812789379291111
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 6. After a(1), these are the primes arising in A069608.

Examples

			a(1) = 6 by definition.
a(2) is the next smallest prime beginning with 6, so a(2) = 61.
a(3) is the next smallest prime beginning with 61, so a(3) = 613.
		

Crossrefs

Programs

  • 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(6)

A236671 Start with 8; 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

8, 83, 839, 83911, 839117, 83911721, 8391172123, 83911721233, 839117212337, 83911721233729, 839117212337293, 83911721233729399, 839117212337293999, 83911721233729399993, 839117212337293999931, 83911721233729399993139
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 8. After a(1), these are the primes arising in A069610.

Examples

			a(1) = 8 by definition.
a(2) is the next smallest prime beginning with 8, so a(2) = 83.
a(3) is the next smallest prime beginning with 83, so a(3) = 839.
		

Crossrefs

Programs

  • Mathematica
    smp[n_]:=Module[{k=1},While[!PrimeQ[n*10^IntegerLength[k]+k],k++];n 10^IntegerLength[k]+ k]; NestList[smp,8,15] (* Harvey P. Dale, Aug 10 2024 *)
  • 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(8)
Showing 1-7 of 7 results.