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.

User: Eric Angelini

Eric Angelini's wiki page.

Eric Angelini has authored 1671 sequences. Here are the ten most recent ones:

A376297 Smallest terms which are the concatenation of two unambiguous distinct integers > 0.

Original entry on oeis.org

12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 120, 130, 140, 150, 160, 170, 180, 190, 202, 203, 204, 205, 206, 207, 208, 209, 210, 220, 222, 230, 240, 250, 260, 270, 280, 290, 330, 333, 340, 350, 360, 370, 380, 390
Offset: 1

Author

Eric Angelini, Sep 19 2024

Keywords

Comments

The sequence is infinite as it can always be extended with the smallest integer <1(n times 0)1> not yet present.

Examples

			10 is not in the sequence because 0 is not > 0.
11 is not in the sequence because 1 and 1 are not distinct.
21 is not in the sequence because 12 is already in it.
101 is in the sequence because it can be unambiguously split into the two distinct integers 10 and 1.
110 is not in the sequence because 101 is already in it.
111 is in the sequence because it can be split into the two distinct integers 1 and 11 (though in two ways).
		

A376128 The absolute difference of two successive terms is prime and the absolute difference of two successive digits is also prime.

Original entry on oeis.org

0, 2, 4, 1, 3, 5, 7, 9, 6, 8, 13, 16, 14, 25, 20, 27, 24, 29, 42, 47, 49, 46, 35, 30, 53, 50, 31, 36, 38, 57, 52, 41, 64, 61, 63, 58, 69, 72, 70, 75, 86, 81, 68, 135, 74, 79, 242, 469, 246, 83, 85, 252, 425, 202, 413, 130, 203, 136, 131, 358, 147, 94, 92, 97, 270, 241, 302, 429, 250, 207, 205, 258, 149
Offset: 1

Author

Eric Angelini and Jean-Marc Falcoz, Sep 11 2024

Keywords

Examples

			Terms a(1) to a(15) are 0,2,4,1,3,5,7,9,6,8,13,16,14,25,20.
The successive absolute differences between two terms are the primes 2,2,3,2,2,2,2,3,2,5,3,2,11,5.
The successive absolute differences between two digits are the primes 2,2,3,2,2,2,2,3,2,7,2,2,5,5,3,2,3,3,2.
		

Crossrefs

Programs

  • Python
    # uses A219248gen in A219248
    from sympy import isprime
    from itertools import count, islice
    def c(an, k):
        return isprime(abs(an-k)) and isprime(abs(an%10-int(str(k)[0])))
    def agen(): # generator of terms
        an, aset = 0, {0}
        while True:
            yield an
            an = next(k for k in A219248gen(seed=str(an%10)) if k not in aset and c(an, k))
            aset.add(an)
    print(list(islice(agen(), 73))) # Michael S. Branicky, Sep 11 2024

A375614 Lexicographically earliest infinite sequence of distinct nonnegative pairs of terms that interpenetrate to produce a prime number.

Original entry on oeis.org

0, 11, 3, 17, 2, 23, 6, 13, 1, 21, 4, 19, 7, 27, 5, 33, 8, 39, 103, 10, 153, 20, 107, 12, 131, 15, 109, 16, 111, 26, 113, 24, 101, 30, 119, 14, 123, 25, 117, 29, 141, 22, 127, 18, 133, 31, 129, 28, 121, 34, 169, 36, 137, 32, 167, 38, 147, 35, 171, 43, 157, 37, 9, 41, 149, 44, 159, 55, 139, 46, 151, 45, 163, 48, 173, 42, 143, 51, 187, 49, 177, 52, 183, 50, 161, 54, 179, 47, 189
Offset: 1

Author

Eric Angelini and Jean-Marc Falcoz, Aug 22 2024

Keywords

Comments

The term a(n) must always be exactly one digit longer or shorter than the term a(n+1).

Examples

			Interpenetrate a(1) = 0 and a(2) = 11 to form 101 (a prime number);
interpenetrate a(2) = 11 and a(3) = 3 to form 131 (a prime number);
interpenetrate a(3) = 3 and a(4) = 17 to form 137 (a prime number);
interpenetrate a(4) = 17 and a(5) = 2 to form 127 (a prime number);
interpenetrate a(5) = 2 and a(6) = 23 to form 223 (a prime number);
interpenetrate a(6) = 23 and a(7) = 6 to form 263 (a prime number);
interpenetrate a(7) = 6 and a(8) = 13 to form 163 (a prime number);
interpenetrate a(8) = 13 and a(9) = 1 to form 113 (a prime number);
(...)
interpenetrate a(18) = 39 and a(19) = 103 to form 13093 (a prime number);
(...)
interpenetrate a(167) = 277 and a(168) = 1009 to form 1207079 (a prime number); etc.
		

Crossrefs

Programs

  • Maple
    Q:= proc(a,b) local La, Lb, i;
      La:= convert(a,base,10);
      Lb:= convert(b,base,10);
      add(La[i]*10^(2*i-2),i=1..nops(La)) + add(Lb[i]*10^(2*i-1),i=1..nops(Lb))
    end proc:
    f:= proc(n) local d,x;
      d:= 1+ilog10(n);
      if n::odd then
        for x from 10^(d-2) to 10^(d-1) - 1 do
          if not(member(x,S)) and isprime(Q(n,x)) then return x fi
        od
      fi;
      for x from 10^d+1 to 10^(d+1) - 1 by 2 do
        if not(member(x,S)) and isprime(Q(x,n)) then return x fi
      od;
    FAIL
    end proc:
    R:= 0,11: S:= {0,11}: v:= 11:
    for i from 2 to 100 do
      v:= f(v);
      R:= R,v;
      S:= S union {v};
    od:
    R; # Robert Israel, Aug 22 2024
  • Python
    from sympy import isprime
    from itertools import islice
    def ip(s, t): return int("".join(x+v for x, v in zip(s, t))+s[-1])
    def agen(): # generator of terms
        seen, an, found = set(), 0, True
        while found:
            yield an
            seen.add(an)
            s = str(an)
            d, found = len(s), False
            if s[-1] in "1379" and d > 1:
                for k in range(10**(d-2), 10**(d-1)):
                    if k not in seen and isprime(ip(s, str(k))):
                        an, found = k, True
                        break
            if not found:
                for k in range(10**d, 10**(d+1)):
                    if k not in seen and isprime(ip(str(k), s)):
                        an, found = k, True
                        break
    print(list(islice(agen(), 90))) # Michael S. Branicky, Aug 22 2024

A375477 Lexicographically earliest sequence of distinct nonnegative terms arranged in successive chunks whose digitsum = 10, said chunks being "linked" (see the Comments section for an explanation).

Original entry on oeis.org

0, 1, 2, 3, 4, 40, 6, 60, 10, 12, 20, 5, 21, 11, 8, 80, 101, 13, 15, 50, 14, 41, 23, 30, 7, 70, 100, 1001, 16, 102, 22, 24, 42, 31, 17, 10001, 19, 91, 103, 33, 32, 104, 43, 111, 105, 110, 100001, 106, 201, 107, 1000001, 109, 901, 112, 51, 113, 120, 10000001, 114, 121
Offset: 1

Author

Keywords

Comments

The 1st chunk with digitsum = 10 is (0, 1, 2, 3, 4), ending with a "4". The next chunk with digitsum = 10 must start with a "4" (this is the "link") and is thus (40, 6). As the next chunk with digitsum = 10 must start with a "6", we have (60, 10, 12). The next chunk with digitsum = 10 must start with a "2" and we have (20, 5, 21), etc.
No chunk is allowed to end with a zero. Thus, no intermediate chunk digit sum can be 9, and anytime a chunk needs a digitsum of 2 to "complete", the next term must be of the form 10^k + 1 for k >= 1.
Infinite since there are an infinity of terms with digits sums <= 10.
a(5367) has 1001 digits.

Crossrefs

Cf. A375460.

Programs

  • Python
    from itertools import count, islice
    def bgen(ds): # generator of terms with digital sum ds
        def A051885(n): return ((n%9)+1)*10**(n//9)-1 # due to Chai Wah Wu
        def A228915(n): # due to M. F. Hasler
            p = r = 0
            while True:
                d = n % 10
                if d < 9 and r: return (n+1)*10**p + A051885(r-1)
                n //= 10; r += d; p += 1
        k = A051885(ds)
        while True: yield k; k = A228915(k)
    def agen(): # generator of terms
        an, ds_block, seen, link_set, min2 = 0, 0, set(), "123456789", 11
        while True:
            yield an
            seen.add(an)
            if ds_block == 8:
                while min2 in seen: min2 = 10*min2 - 9
                an, ds_an, link_an = min2, 2, "1"
            else:
                cand_ds = list(range(1, 9-ds_block)) + [10-ds_block]
                dsg = [0] + [bgen(i) for i in range(1, 11-ds_block)]
                dsi = [0] + [(next(dsg[i]), i) for i in range(1, 11-ds_block)]
                while True:
                    k, ds_k = min(dsi[j] for j in cand_ds)
                    if k not in seen:
                        sk, dst = str(k), ds_k + ds_block
                        if sk[0] in link_set:
                            if dst < 9 or (dst == 10 and k%10 != 0):
                                an, ds_an, link_an = k, ds_k, sk[-1]
                                break
                    dsi[ds_k] = (next(dsg[ds_k]), ds_k)
            ds_block = ds_block + ds_an
            if ds_block == 10: ds_block, link_set = 0, link_an
            else: link_set = "123456789"
    print(list(islice(agen(), 60)))

A375460 Lexicographically earliest sequence of distinct nonnegative terms arranged in successive chunks whose digitsum = 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 11, 20, 6, 12, 100, 7, 21, 8, 101, 9, 1000, 13, 14, 10000, 15, 22, 16, 30, 17, 110, 18, 100000, 19, 23, 31, 1000000, 24, 40, 25, 102, 26, 200, 27, 10000000, 28, 32, 41, 33, 103, 34, 111, 35, 1001, 36, 100000000, 37, 42, 112, 43, 120, 44, 1010, 45, 1000000000
Offset: 1

Author

Eric Angelini, Aug 15 2024

Keywords

Comments

The first integer that will never appear in the sequence is 29, as its digitsum exceeds 10.
From Michael S. Branicky, Aug 16 2024: (Start)
Infinite since A052224 is infinite (as are all sequences with digital sum 1..10).
a(6492) has 1001 digits. (End)

Examples

			The first chunk of integers with digitsum 10 is (0,1,2,3,4);
the next one is (5,10,11,20),
the next one is (6,12,100),
the next one is (7,21),
the next one is (8,101),
the next one is (9,1000),
the next one is (13,14,10000), etc.
The concatenation of the above chunks produce the sequence.
		

Crossrefs

Numbers with digital sum 1..10: A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10).

Programs

  • Python
    from itertools import islice
    def bgen(ds): # generator of terms with digital sum ds
        def A051885(n): return ((n%9)+1)*10**(n//9)-1 # due to Chai Wah Wu
        def A228915(n): # due to M. F. Hasler
            p = r = 0
            while True:
                d = n % 10
                if d < 9 and r: return (n+1)*10**p + A051885(r-1)
                n //= 10; r += d; p += 1
        k = A051885(ds)
        while True: yield k; k = A228915(k)
    def agen(): # generator of terms
        an, ds_block = 0, 0
        dsg = [None] + [bgen(i) for i in range(1, 11)]
        dsi = [None] + [(next(dsg[i]), i) for i in range(1, 11)]
        while True:
            yield an
            an, ds_an = min(dsi[j] for j in range(1, 11-ds_block))
            ds_block = (ds_block + ds_an)%10
            dsi[ds_an] = (next(dsg[ds_an]), ds_an)
    print(list(islice(agen(), 61))) # Michael S. Branicky, Aug 16 2024

Extensions

a(46) and beyond from Michael S. Branicky, Aug 16 2024.

A375380 Lexicographically earliest sequence S of distinct nonnegative integers such that 9 out of the last 10 digits of S always sum to a square.

Original entry on oeis.org

1000000000, 0, 1, 2, 3, 4, 6, 5, 7, 8, 9, 10, 11, 13, 12, 15, 14, 17, 16, 21, 18, 19, 20, 27, 22, 25, 23, 30, 24, 26, 31, 28, 29, 32, 34, 33, 36, 38, 35, 37, 40, 39, 41, 42, 43, 44, 47, 45, 50, 46, 51, 48, 52, 54, 55, 49, 57, 53, 56, 58, 59, 60, 64, 61, 62, 63
Offset: 1

Author

Eric Angelini, Aug 14 2024

Keywords

Comments

The smallest available 10-digit integer to start S with is a(1) = 1000000000.
The sequence is infinite as there are infinitely many integers whose 9 of the last 10 digits sum to a square.

Examples

			We start with a(1) = 1000000000:
S = 1000000000,
The last 10 digits of S are [1000000000]; we discard a 0 and the sum of the 9 remaining digits = 1 (a square). We try to extend S with 0:
S = 1000000000,0,
The last 10 digits of S are [0000000000]; we discard a 0 and the sum of the 9 remaining digits = 0 (a square). We try to extend S with 1:
S = 1000000000,0,1,
The last 10 digits of S are [0000000001]; we discard a 0 and the sum of the 9 remaining digits = 1 (a square). We try to extend S with 2:
S = 1000000000,0,1,2,
The last 10 digits of S are [0000000012]; we discard 2 and the sum of the 9 remaining digits = 1 (a square). We try to extend S with 3:
S = 1000000000,0,1,2,3,
The last 10 digits of S are [0000000123]; we discard 2 and the sum of the 9 remaining digits = 4 (a square). We try to extend S with 4:
S = 1000000000,0,1,2,3,4,
The last 10 digits of S are [0000001234]; we discard 1 and the sum of the 9 remaining digits = 9 (a square). We try to extend S with 5:
S = 1000000000,0,1,2,3,4,5,
The last 10 digits of S are [0000012345]; as no square can be reached, whatever we discard, we don’t extend S with 5. We try to extend S with 6:
S = 1000000000,0,1,2,3,4,6,
The last 10 digits of S are [0000012346]; we discard a 0 and the sum of the 9 remaining digits = 16 (a square).
Etc.
		

Crossrefs

Cf. A352000.

Programs

  • Python
    from itertools import count, islice, combinations
    def f(k, last10):
        d = list(map(int, str(k)))
        if len(d) >= 10: return d[-10:]
        else: return last10[len(d):] + d
    def c(k, last10):
        for pick9 in combinations(f(k, last10), 9):
            if sum(pick9) in {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}:
                return True
        return False
    def agen(): # generator of terms
        an, seen, last10, mink = 1000000000, set(), [], 0
        while True:
            yield an
            seen.add(an)
            last10 = f(an, last10)
            an = next(k for k in count(mink) if k not in seen and c(k, last10))
            while mink in seen: mink += 1
    print(list(islice(agen(), 66))) # Michael S. Branicky, Aug 14 2024

Extensions

a(14) and beyond from Michael S. Branicky, Aug 14 2024

A375328 Terms as well as digits fit the prime/prime/nonprime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

2, 3, 0, 5, 7, 1, 23, 13, 20, 37, 17, 21, 53, 43, 24, 73, 47, 26, 229, 239, 22, 67, 29, 25, 83, 31, 27, 97, 59, 32, 127, 137, 4, 251, 271, 33, 157, 173, 6, 331, 359, 35, 433, 457, 8, 379, 521, 52, 653, 673, 9, 571, 739, 55, 677, 823, 12, 71, 751, 57, 827, 853, 15, 79, 2203, 28, 2207, 263, 30, 2213, 283, 34, 2243
Offset: 1

Author

Eric Angelini and Jean-Marc Falcoz, Aug 13 2024

Keywords

Examples

			a(4) = 5, a(5) = 7, a(6) = 1, a(7) = 23, a(8) = 13, a(9) = 20; we see that a(4), a(5), a(7) and a(8) are primes and that a(6) and a(9) are nonprimes. The digits involved fit the pattern prime/prime/nonprime too; they are 5,7,1,2,3,1,3,2 and 0.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with p/p/np, p/np/p, or np/p/p digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)%3 < 2] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(1):
            p = (n-1)%3 < 2
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 13 2024

A375327 Terms as well as digits fit the nonprime/nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 1, 2, 4, 6, 3, 8, 9, 5, 10, 20, 13, 14, 21, 17, 16, 24, 43, 18, 26, 47, 40, 28, 67, 44, 30, 83, 46, 34, 97, 48, 36, 131, 12, 49, 7, 60, 38, 139, 15, 64, 29, 42, 66, 31, 45, 68, 59, 62, 69, 71, 63, 80, 79, 65, 81, 211, 39, 82, 11, 50, 85, 19, 51, 87, 41, 54, 92, 61, 56, 93, 89, 58, 95, 103, 84, 70, 151, 120
Offset: 1

Author

Eric Angelini and Jean-Marc Falcoz, Aug 13 2024

Keywords

Examples

			a(9) = 5, a(10) = 10, a(11) = 20, a(12) = 13, a(13) = 14, a(14) = 21 ; we see that a(9) and a(12) are primes and that a(10), a(11), a(13); and a(14) are nonprimes. The digits involved fit the pattern nonprime/nonprime/prime too; they are 5,1,0,2,0,1,3,1,4,2 and 1.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with np/np/p, np/p/np, or p/np/np digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)%3 == 2] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if digits==1 or s[0]!="0")
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(1):
            p = (n-1)%3 == 2
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 13 2024

A375326 Terms as well as digits fit the nonprime/prime pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 2, 1, 3, 4, 5, 6, 7, 8, 29, 20, 31, 21, 59, 24, 71, 26, 79, 28, 263, 9, 283, 12, 13, 15, 17, 42, 43, 45, 47, 62, 67, 63, 83, 65, 97, 82, 131, 30, 293, 85, 139, 34, 307, 87, 151, 36, 313, 92, 179, 38, 317, 93, 421, 39, 347, 95, 431, 50, 367, 120, 383, 121, 397, 124, 503, 126, 547, 128, 563, 129, 587, 130
Offset: 1

Author

Eric Angelini and Jean-Marc Falcoz, Aug 12 2024

Keywords

Examples

			a(9) = 8, a(10) = 29, a(11) = 20, a(12) = 31; we see that a(9) and a(11) are nonprimes and that a(10) and a(12) are primes. The digits involved fit the pattern nonprime/prime too; they are 8, 2, 9, 2, 0, 3, 1.
		

Crossrefs

Cf. A217555.

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def bgen(i): # generates terms with prime/nonprime or nonprime/prime digits
        digs = ["014689", "2357"]
        for digits in count(1):
            patt = [digs[(i+j)&1] for j in range(digits)]
            yield from (int("".join(s)) for s in product(*patt) if s[0]!="0")
    def agen(): # generator of terms
        seen, s, an = {0, 2}, 2, 2
        yield from [0, 2]
        for n in count(3):
            p = (n&1) == 0
            an = next(k for k in bgen(s) if k not in seen and isprime(k)==p)
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 12 2024

A375306 Terms as well as digits fit the even/odd/odd pattern; this is the lexicographically earliest injective sequence with this property.

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 101, 10, 11, 21, 12, 13, 23, 14, 15, 25, 16, 17, 27, 18, 19, 29, 30, 31, 41, 32, 33, 43, 34, 35, 45, 36, 37, 47, 38, 39, 49, 50, 51, 61, 52, 53, 63, 54, 55, 65, 56, 57, 67, 58, 59, 69, 70, 71, 81, 72, 73, 83, 74, 75, 85, 76, 77, 87, 78, 79, 89, 90, 91, 211, 6, 93, 213, 8, 95, 215, 2110, 97
Offset: 1

Author

Eric Angelini, Aug 11 2024

Keywords

Examples

			a(7) = 4, a(8) = 9, a(9) = 101, a(10) = 10; terms follow the even/odd/odd pattern and so do their digits: 4/9/1 and 0/1/1.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice, repeat
    def c(s, i):
        return all(int(d)%2 == int((i+j)%3 > 0) for j, d in enumerate(s))
    def agen(): # generator of terms
        seen, s = set(), 0
        for n in count(0):
            eo = int(n%3 > 0)
            an = next(k for k in count(eo, 2) if k not in seen and c(str(k), s))
            yield an
            seen.add(an)
            s += len(str(an))
    print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 11 2024