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

A089702 a(1) = 2 then primes in nondecreasing order such that every concatenation is prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 23, 43, 59, 67, 83, 199, 239, 421, 569, 613, 1307, 2017, 2129, 2467, 2741, 2953, 3011, 3319, 3413, 3607, 3617, 5449, 6917, 7333, 7529, 8389, 10211, 10357, 12641, 12703, 15077, 17107, 21341, 21799, 22469, 32911, 33587, 33613, 33647
Offset: 0

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Examples

			2,23,233,2333,23333,2333323 etc. are primes.
		

Crossrefs

Cf. A089703.

Programs

  • Maple
    ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: a:=[2]: k:=1: for n from 1 to 50 do l:=nops(a): for i from k do p:=ithprime(i): if isprime(ds([op(convert(p,base,10)),seq(op(convert(a[l-j],base,10)),j=0..l-1)])) then a:=[op(a),p]: k:=i: break fi od od: op(a); # C. Ronaldo

Extensions

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004

A158191 Attach the smallest prime to the end of the string a(n-1) so a(n) is also prime.

Original entry on oeis.org

2, 23, 233, 2333, 23333, 2333323, 23333237, 233332373, 23333237353, 2333323735319, 2333323735319149, 2333323735319149571, 23333237353191495713, 23333237353191495713131, 233332373531914957131313
Offset: 1

Views

Author

Sergio Pimentel, Mar 13 2009

Keywords

Comments

a(279) has 1001 digits. - Michael S. Branicky, May 26 2023

Examples

			a(6) = 2333323 since a(5) = 23333 (prime) and 233333, 233335, 233337, 2333311, 2333313, 2333317 and 2333319 are all composite.
		

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=3},While[CompositeQ[n*10^IntegerLength[k]+k],k = NextPrime[ k]];n*10^IntegerLength[k]+k]; NestList[nxt,2,20] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 13 2019 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p, s = 2, "2"
        while True:
            yield p
            q = 2
            while not isprime(p:=int(s+str(q))):
                q = nextprime(q)
            s += str(q)
    print(list(islice(agen(), 15))) # Michael S. Branicky, May 26 2023

Extensions

More terms from Sean A. Irvine, Nov 29 2009
Showing 1-2 of 2 results.