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

A336285 a(0) = 0; for n > 0, a(n) is the least positive integer not occurring earlier such that the digits in a(n-1)+a(n) are all distinct.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 22 2020

Keywords

Comments

In other words, for any n > 0, a(n) + a(n+1) belongs to A010784.
The sequence is finite since there are only a finite number of positive integers with distinct digits, see A010784, although the exact number of terms is currently unknown.

Examples

			The first terms, alongside a(n) + a(n+1), are:
  n   a(n)  a(n)+a(n+1)
  --  ----  -----------
   0     0            1
   1     1            3
   2     2            5
   3     3            7
   4     4            9
   5     5           12
   6     7           13
   7     6           14
   8     8           17
   9     9           19
  10    10           21
		

Crossrefs

Programs

  • PARI
    s=0; v=1; for (n=1, 67, print1 (v", "); s+=2^v; for (w=1, oo, if (!bittest(s, w) && #(d=digits(v+w))==#Set(d), v=w; break)))
    
  • Python
    def agen():
      alst, aset, min_unused = [0], {0}, 1
      yield 0
      while True:
        an = min_unused
        while True:
          while an in aset: an += 1
          t = str(alst[-1] + an)
          if len(t) == len(set(t)):
            alst.append(an); aset.add(an); yield an
            if an == min_unused: min_unused = min(set(range(max(aset)+2))-aset)
            break
          an += 1
    g = agen()
    print([next(g) for n in range(77)]) # Michael S. Branicky, Mar 11 2021

Extensions

a(0)=0 added by N. J. A. Sloane, Mar 14 2021

A368181 a(1) = 1; for n > 1, a(n) is the smallest positive integer that has not yet appeared which shares no digit with the sum of all previous terms a(1)..a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Dec 21 2023

Keywords

Comments

The sequence is finite; after 14594 terms, where a(14594) = 20858, the sum of all terms is 173658294 which contains the digits 1..9, so the next term does not exist.
The largest term is a(12742) = 888888.

Examples

			a(14) = 20 as the sum of all terms a(1)..a(13) = 91, and 20 is the smallest unused number that does not contain the digits 1 or 9.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    def agen():
      s, aset, mink = 0, {0}, 1
      while True:
          k, dset = mink, set(str(s))
          if dset >= set("123456789"): break
          while k in aset or set(str(k)) & dset: k += 1
          an = k; aset.add(an); s += an; yield an
          while mink in aset: mink += 1
    print(list(islice(agen(), 80))) # Michael S. Branicky, Dec 21 2023

A368347 a(1) = 1; for n > 1, a(n) is the smallest positive integer that has not yet appeared which contains all the distinct digits of the sum of all previous terms a(1)..a(n-1).

Original entry on oeis.org

1, 10, 11, 2, 24, 48, 69, 156, 123, 4, 84, 235, 67, 348, 128, 103, 134, 1457, 304, 308, 136, 2357, 1069, 178, 3567, 10239, 126, 182, 10247, 137, 13458, 12345, 567, 2458, 2068, 20567, 1378, 45689, 10348, 102347, 203479, 4568, 12456, 234568, 105689, 3089, 20689, 12678, 204589, 1048, 1023459
Offset: 1

Views

Author

Scott R. Shannon, Dec 22 2023

Keywords

Comments

The sequence is infinite, although it is unknown if all positive numbers eventually appear. In the first 50000 terms the smallest number not to have appeared is 3. In the same range the largest value is a(49134) = 1023548967, with the sum of all previous terms at that point being 553402987165.

Examples

			a(3) = 11 as the sum of the first two terms is 1 + 10 = 11, which contains the distinct digit 1, and 11 is the smallest unused number to contain 1.
a(4) = 2 as the sum of the first three terms is 1 + 10 + 11 = 22, which contains the distinct digit 2, and 2 is the smallest unused number to contain 2.
a(5) = 24 as the sum of the first four terms is 1 + 10 + 11 + 2 = 24, which contains the distinct digits 2 and 4, and 24 is the smallest unused number to contain 2 and 4.
		

Crossrefs

Showing 1-3 of 3 results.