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

A152136 a(0) = 0; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that the concatenation of any two consecutive digits in the sequence is a prime.

Original entry on oeis.org

0, 2, 3, 7, 9, 71, 73, 79, 711, 713, 717, 971, 973, 1111, 1113, 1117, 1119, 7111, 7113, 7117, 9711, 9713, 11111, 11113, 11117, 11119, 71111, 71113, 71117, 97111, 97113, 111111, 111113, 111117, 111119, 711111, 711113, 711117, 971111
Offset: 0

Views

Author

N. J. A. Sloane, Sep 24 2009

Keywords

Comments

A variant of A152607 suggested by Zak Seidov, Sep 24 2009.
Computed by Jean-Marc Falcoz.
Comment from Jean-Marc Falcoz: (Start)
The sequence is infinite since it has the following structure:
9713, 11111, 11113, 11117, 11119, 71111, 71113, 71117, 97111,
97113, 111111, 111113, 111117, 111119, 711111, 711113, 711117, 971111,
971113, 1111111, 1111113, 1111117, 1111119, 7111111, 7111113, 7111117, 9711111,
9711113, 11111111, 11111113, 11111117, 11111119, 71111111, 71111113, 71111117, 97111111,
97111113, 111111111, 111111113, 111111117, 111111119, 711111111, 711111113, 711111117, 971111111,
971111113, 1111111111, 1111111113, 1111111117, 1111111119, 7111111111, 7111111113, 7111111117, 9711111111,
9711111113, ... (End)

Crossrefs

Extensions

Offset changed by N. J. A. Sloane, Jun 16 2021

A152604 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that any four consecutive digits in the sequence sum up to a prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 9, 51, 83, 110, 111, 211, 301, 310, 311, 631, 703, 710, 911, 2111, 2113, 2117, 2119, 2153, 2155, 2159, 2171, 2173, 2177, 2179, 2513, 2515, 2519, 2531, 2533, 2537, 2539, 2573, 2575, 2579, 8513, 8515, 8519, 8573, 8579, 8591
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.
From a(69)=1100110 onward starts a repeating pattern of length 54. - M. F. Hasler, Oct 16 2009

Crossrefs

Programs

  • PARI
    A152604(n,show_all=0)={my(a);for(i=1,n,if( i<8,a=i+(i>3)+(i>4), my(l3d=if(a>99,a%1000,[789,951,183][i-7])); while( a++, my(t=a+l3d*10^#Str(a));forstep(d=#Str(a)-1,0,-1, isprime(sum(j=d,d+3,t\10^j%10)) & next; a+=10^d-a%10^d-1; next(2)); break)); show_all&print1(a", "));a} \\ M. F. Hasler, Oct 16 2009

A152609 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that the concatenation of any four consecutive digits in the sequence is a prime.

Original entry on oeis.org

1, 2, 3, 7, 19, 31, 91, 373, 931, 1931, 1933, 7193, 11931, 19311, 93119, 311931, 913733, 1373313, 7331373, 9311931, 19311931, 19311933, 71931193, 119311931, 193119311, 931193119, 3119311931, 9137331373, 9311931193
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.

Crossrefs

A152607 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that the concatenation of any two consecutive digits in the sequence is a prime.

Original entry on oeis.org

1, 3, 7, 9, 71, 73, 79, 711, 713, 717, 971, 973, 1111, 1113, 1117, 1119, 7111, 7113, 7117, 9711, 9713, 11111, 11113, 11117, 11119, 71111, 71113, 71117, 97111, 97113, 111111, 111113, 111117, 111119, 711111, 711113, 711117, 971111
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.
Comment from Jean-Marc Falcoz: (Start)
The sequence is infinite since it has the following structure:
9713, 11111, 11113, 11117, 11119, 71111, 71113, 71117, 97111,
97113, 111111, 111113, 111117, 111119, 711111, 711113, 711117, 971111,
971113, 1111111, 1111113, 1111117, 1111119, 7111111, 7111113, 7111117, 9711111,
9711113, 11111111, 11111113, 11111117, 11111119, 71111111, 71111113, 71111117, 97111111,
97111113, 111111111, 111111113, 111111117, 111111119, 711111111, 711111113, 711111117, 971111111,
971111113, 1111111111, 1111111113, 1111111117, 1111111119, 7111111111, 7111111113, 7111111117, 9711111111,
9711111113, ... (End)

Crossrefs

Cf. A158652, A152604-A152609. See A152136 for another version.

Programs

  • Python
    from itertools import count, islice
    def cgen(seed, digits, geq="0"): # numbers satisfying the condition
        allowed = {"1": "1379", "3": "17", "7": "139", "9": "7"}
        if digits == 1:
            yield from (c for c in allowed[seed] if c >= geq); return
        for f in (c for c in allowed[seed] if c >= geq):
            yield from (f + r for r in cgen(f, digits-1))
    def nextc(k): # next element of cgen greater than k
        s = str(k)
        for d in count(len(s)):
            geq = s[0] if d == len(s) else "0"
            for c in map(int, cgen(s[-1], d, geq=geq)):
                if c > k: return c
    def agen():
        an = 1
        for n in count(1): yield an; an = nextc(an)
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jul 12 2022
    
  • Python
    # alternate using pattern from comments
    from itertools import count, islice
    def agen():
        yield from [1, 3, 7, 9, 71, 73, 79, 711, 713, 717, 971]
        for i in count(0):
            i1 = "1"*i
            yield from map(int, ("97"+i1+"3", i1+"1111", i1+"1113", i1+"1117", i1+"1119", "7111"+i1, "711"+i1+"3", "711"+i1+"7", "9711"+i1))
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jul 12 2022

A152603 a(1) = 1; thereafter, a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that any three consecutive digits in the sequence sum up to a prime.

Original entry on oeis.org

1, 2, 4, 5, 8, 41, 60, 70, 410, 412, 416, 418, 452, 454, 458, 470, 472, 476, 478, 812, 814, 818, 830, 832, 836, 838, 872, 874, 878, 2101, 2210, 2300, 2302, 3002, 3003, 4011, 5110, 6101, 6410, 6500, 7002, 9020, 9200, 20020, 30020, 30021, 40110
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.
From a(34)=3002 on, there starts a pattern [ 3(002){n}, ..., 2(002){n+1} ] of length 52 which then repeats forever. This allows us to write an explicit formula for any term a(n) of the sequence. - M. F. Hasler, Oct 16 2009

Crossrefs

Programs

  • PARI
    A152603(n,show_all=0)={ my(a); for(i=1,n, if(i<4,a=2^i/2, my( l2d=a%100+if(i<7,10*[1,2,4,5][i-2])); while(a++,my(t=a+l2d*10^#Str(a)); forstep(d=#Str(a)-1,0,-1, isprime(z=t\10^d%10+t\10^(d+1)%10+t\10^(d+2)%10) & next; a+=10^d-a%10^d-1; next(2)); break)); show_all&print1(a", ")); a} \\ M. F. Hasler, Oct 16 2009

Formula

a(n) = b(n)*10^[3n/52] = c(n)*10^(3n/52) with (except for smaller initial terms) 20 < b(n) < 611 and c(52k+23) = 9.89... < c(n) < c(52k) = 91.1... for all integers k > 0. - M. F. Hasler, Oct 16 2009

A152605 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that any five consecutive digits in the sequence sum up to a prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 12, 30, 51, 83, 231, 232, 312, 323, 327, 413, 414, 530, 541, 701, 811, 812, 1101, 2110, 3011, 6301, 7030, 7103, 8110, 9011, 21011, 21013, 21017, 21019, 21053, 21055, 21059, 21071, 21073, 21077, 21079, 21413, 21415, 21419
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.
From a(116)=6100011 on, there starts a pattern of 75 terms which then repeats indefinitely (with duplication of a substring of 5 digits in the middle of each term). - M. F. Hasler, Oct 16 2009

Crossrefs

Programs

  • PARI
    A152605(n,show_all=0,s=[1, 2, 3, 4, 7, 12, 30, 51, 83, 231, 232, 312, 323, 327, 413, 414, 530, 541, 701, 811, 812, 1101])={ my(a); for(i=1,n, if(i<=#s,a=s[i], my(ld=a%10^4); while(a++,my(t=a+ld*10^#Str(a));forstep(d=#Str(a)-1,0,-1,isprime(sum(j=d,d+4,t\10^j%10))&next;a+=10^d-a%10^d-1;next(2));break));show_all&print1(a", "));a } \\ M. F. Hasler, Oct 16 2009

A152608 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that the concatenation of any three consecutive digits in the sequence is a prime.

Original entry on oeis.org

1, 2, 7, 19, 37, 39, 71, 91, 93, 733, 739, 773, 971, 977, 3311, 3733, 7331, 7337, 9719, 9773, 31131, 31137, 33113, 73311, 311311, 311313, 733113, 733131, 733137, 971911, 3113113, 7331131, 7331137, 9719113, 9719191, 9719193
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.

Crossrefs

A152606 a(1) = 1; thereafter a(n) is always the smallest integer > a(n-1) not leading to a contradiction, such that any six consecutive digits in the sequence sum up to a prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 21, 45, 83, 89, 450, 503, 630, 701, 810, 901, 2101, 2103, 4121, 6301, 6303, 6503, 6901, 43030, 70103, 81010, 90101, 210101, 210103, 210107, 210109, 210143, 210145, 210149, 210161, 210163, 210167, 210169, 210503
Offset: 1

Views

Author

N. J. A. Sloane, Sep 23 2009

Keywords

Comments

Computed by Jean-Marc Falcoz.
From a(269) = 1010001010 on, there starts a pattern of 104 terms, which then repeats indefinitely (with 6 digits in the middle of each term duplicated). - M. F. Hasler, Oct 16 2009

Crossrefs

Programs

  • PARI
    a(n, show_all=0, s=[1, 2, 3, 4, 5, 8, 9, 21, 45, 83, 89, 450, 503, 630, 701, 810, 901, 2101, 2103, 4121, 6301, 6303, 6503, 6901, 43030])={ my(a,nd=#Str(s[ #s])); for(i=1,n, if( i<=#s, a=s[i], my(ld=a%10^nd); while(a++,my(t=a+ld*10^#Str(a));forstep(d=#Str(a)-1,0,-1,isprime(sum(j=d,d+nd,t\10^j%10))&next;a+=10^d-a%10^d-1; next(2));break));show_all & print1(a", "));a} \\ M. F. Hasler, Oct 16 2009

A354839 Beginning with 0, smallest positive integer not yet in the sequence such that the concatenation of two digits of the sequence separated by a comma is prime.

Original entry on oeis.org

0, 2, 3, 1, 7, 9, 70, 5, 30, 20, 21, 10, 22, 31, 11, 12, 32, 33, 13, 14, 15, 34, 16, 17, 18, 35, 36, 19, 71, 37, 38, 39, 72, 90, 23, 73, 74, 75, 91, 76, 77, 92, 93, 78, 94, 79, 700, 24, 100, 25, 95, 96, 101, 97, 98, 99, 701, 102, 300, 26, 103, 104, 105, 301
Offset: 0

Views

Author

Carole Dubois, Jun 08 2022

Keywords

Examples

			a(4)=1 because this is the first number not in the sequence whose first digit is 3 (last digit of a(3)), concatenated with its first digit 1, is prime: 31.
a(14)=31 because this is the first number not in the sequence whose first digit is 2 (last digit of a(13)), concatenated with its first digit 3, is prime: 23.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        aset, k, mink = {0}, 0, 1; yield 0
        for n in count(2):
            k, prevdig = mink, str(k%10)
            while k in aset or not isprime(int(prevdig+str(k)[0])): k += 1
            aset.add(k); yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 64))) # Michael S. Branicky, Jun 09 2022
Showing 1-9 of 9 results.