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

A158652 Any two consecutive digits in the sequence sum up to a prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 41, 43, 47, 49, 83, 85, 89, 202, 302, 303, 411, 412, 502, 503, 830, 2020, 2021, 2023, 2025, 2029, 2030, 2032, 3020, 3021, 4111, 4112, 5020, 5021, 6111, 6112, 9202, 9203, 20202, 30202, 30203, 41111, 41112, 50202, 50203, 83020, 202020
Offset: 1

Views

Author

Eric Angelini, Mar 23 2009

Keywords

Comments

a(1)=1 and a(n) is always the smallest integer > a(n-1) not leading to a contradiction. Terms computed by M. F. Hasler.
From M. F. Hasler, Mar 24 2009: (Start)
After the initial 2,3,4,7,41,43,47,49,83,85,89, the following pattern repeats:
202,302,303,
411,412,502,503,830,
2020,2021,2023,2025,2029,2030,2032,3020,3021,
4111,4112,5020,5021,6111,6112,9202,9203,
with each time two extra digits (either 02 or 11):
20202,30202,30203,
41111,41112,50202,50203,83020,
202020,202021,202023,202025,202029,202030,202032,302020,302021,
411111,411112,502020,502021,611111,611112,920202,920203,
and so on. (End)

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{k = s[[ -1]] + 1, ls = Mod[ s[[ -1]], 10]}, While[ Union@ PrimeQ[ Plus @@@ Partition[ Join[{ls}, IntegerDigits@ k], 2, 1]] != {True}, k++ ]; Append[s, k]]; Nest[f, {1}, 45] (* Robert G. Wilson v, Apr 05 2009 *)
  • Python
    from itertools import count, islice
    allowed = {"0":"2357", "1":"1246", "2":"01359", "3":"0248", "4":"1379", "5":"0268", "6":"157", "7":"046", "8":"359", "9":"248"}
    def cgen(seed, digits, geq="0"): # numbers satisfying the condition
        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 "1"
            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

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

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

A342215 Two successive terms always share a common "digit pattern" (see the Comments section). The successive "common digit patterns", concatenated, reproduce the successive terms of the sequence, concatenated.

Original entry on oeis.org

1, 10, 100, 101, 1201, 301, 12, 20, 104, 13, 30, 102, 14, 21, 2, 200, 103, 410, 341, 3, 203, 105, 210, 421, 1242, 112, 204, 50, 106, 310, 34, 41, 107, 230, 43, 114, 31, 23, 205, 303, 113, 108, 305, 25, 121, 109, 40, 24, 123, 15, 120, 42, 1142, 211, 26, 207, 140, 45, 250, 110, 610, 36, 131, 160, 302, 134, 4
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Mar 05 2021

Keywords

Comments

A "common pattern" shared by two successive integers A and B is a string of digits present in both A and B. For example, if A = 1 and B = 10 the common pattern is "1"; if A = 2021 and B = 302 the common pattern is "02".
We allow the successive terms A and B to share more than one pattern, but only in the case of a single shared longer string of digits - longer than the other possible strings; as A = 2021 and B = 231 share both the strings "2" and "1", which are of the same length, B cannot follow A in the sequence. As A = 2021 and B = 2031 share both the strings "20" and "1" and as the string "20" is longer than the string "1", B could follow A in the sequence (the "common pattern" would be "20" here).
This "common pattern" idea was imagined to inspire people having almost no mathematical skills - only two eyes (or one single eye) and a pencil.
Caveat: to reduce the computing time, no term > 10000 was tested.
Given the doubts about this sequence, please do NOT add a b-file. N. J. A. Sloane, Mar 14 2021

Examples

			The first ten terms are 1, 10, 100, 101, 1201, 301, 12, 20, 104, 13.
The "common patterns" are 1  10   10   01    01    1   2   0    1 and their concatenation is 1101001011201 - which is exactly the start of the concatenation of the sequence's terms.
		

Crossrefs

Showing 1-4 of 4 results.