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-10 of 14 results. Next

A067581 a(n) = smallest integer not yet in the sequence with no digits in common with a(n-1), a(0)=0.

Original entry on oeis.org

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

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

David W. Wilson has shown that the sequence contains every positive integer except those containing all the digits 1 through 9 (which obviously have no possible predecessor). Jun 04 2002
a(A137857(n)) = A137857(n). - Reinhard Zumkeller, Feb 15 2008

Examples

			a(14) = 13, since a(13) = 20 and all integers smaller than 13 have a digit in common with 20 or have already appeared in the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (delete, intersect); import Data.Function (on)
    a067581 n = a067581_list !! (n-1)
    a067581_list = 1 : f 1 [2..] where
       f u vs = v : f v (delete v vs)
         where v : _ = filter (null . (intersect `on` show) u) vs
    -- Reinhard Zumkeller, Jul 01 2013
    
  • Mathematica
    f[s_List] := Block[{k = 1, id = IntegerDigits@ s[[ -1]]}, While[ MemberQ[s, k] || Intersection[id, IntegerDigits@k] != {}, k++ ]; Append[s, k]]; Nest[f, {1}, 71] (* Robert G. Wilson v, Apr 03 2009 *)
  • PARI
    {u=0; a=0; for(n=0, 99, print1(a", "); u+=1<M. F. Hasler, Nov 01 2014
    
  • Python
    from itertools import count, islice, product as P
    def only(s, D=1): # numbers with >= D digits only from s
        yield from (int("".join(p)) for d in count(D) for p in P(s, repeat=d))
    def agen(): # generator of terms
        aset, an, minan = {0}, 0, 1
        while True:
            yield an
            an, s = minan, set(str(an))
            use = "".join(c for c in "0123456789" if c not in s)
            for an in only(use, D=len(str(minan))):
                if an not in aset: break
            aset.add(an)
            while minan in aset: minan += 1
    print(list(islice(agen(), 73))) # Michael S. Branicky, Jun 30 2022

Extensions

Extended to a(0)=0 by M. F. Hasler, Nov 02 2014

A342441 a(1) = 1; for n > 1, a(n) is the least positive integer not occurring earlier such that a(n-1)+a(n) shares no digit with either a(n-1) or a(n).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 12 2021

Keywords

Comments

No term can end in 0 as that would result in the last digit of a(n-1) being the same as the last digit of a(n-1)+a(n).

Examples

			a(2) = 2 as a(1)+2 = 1+2 = 3 which shares no digit with a(1) = 1 or 2.
a(10) = 11 as a(9)+11 = 9+11 = 20 which shares no digit with a(9) = 9 or 11. Note that the first number skipped is 10 as 9+10 = 19 which shares a digit with 9.
a(11) = 13 as a(10)+13 = 11+13 = 24 which shares no digit with a(10) = 11 or 13. Note that the number 12 is skipped as 11+12 = 23 which shares a digit with 12.
		

Crossrefs

Cf. A342442 (multiplication), A276633, A010784, A043537, A043096, A338466, A336285.

Programs

  • Mathematica
    Block[{a = {1}, m = {1}, d, s, k}, Do[k = 2; While[Nand[FreeQ[a, k], ! IntersectingQ[Set[d, IntegerDigits[k]], Set[s, IntegerDigits[a[[-1]] + k]]], ! IntersectingQ[s, m]], k++]; AppendTo[a, k]; Set[m, d], 72]; a] (* Michael De Vlieger, Mar 20 2021 *)
  • Python
    def aupton(terms):
      alst, aset = [1], {1}
      while len(alst) < terms:
        an, anm1_digs = 2, set(str(alst[-1]))
        while True:
          while an in aset: an += 1
          if (set(str(an)) | anm1_digs) & set(str(an+alst[-1])) == set():
            alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupton(73)) # Michael S. Branicky, Mar 20 2021

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

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

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

The sequence is finite, the 71782nd term being a(71781) = 50005 beyond which no number exists that has not occurred earlier such that 50005*a(n) has distinct digits. The maximum term is a(71428) = 175446.

Examples

			a(1) = 1 as a(0)*1 = 0*1 = 0 which has one distinct digit 0.
a(10) = 10 as a(9)*10 = 9*10 = 90 which has two distinct digits 9 and 0.
a(11) = 12 as a(10)*12 = 10*12 = 120 which has three distinct digits. Note that 11 is the first skipped number as 10*11 = 110 which has 1 as a duplicate digit.
a(12) = 11 as a(11)*11 = 12*11 = 132 which has three distinct digits.
		

Crossrefs

Extensions

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

A342442 a(1) = 2; for n > 1, a(n) is the least positive integer not occurring earlier such that a(n-1)*a(n) shares no digit with either a(n-1) or a(n).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 42, 14, 17, 18, 15, 16, 13, 19, 32, 22, 23, 26, 29, 12, 25, 24, 34, 27, 33, 36, 39, 43, 37, 38, 28, 47, 44, 45, 46, 63, 66, 65, 48, 49, 62, 55, 54, 35, 174, 53, 76, 57, 56, 59, 52, 58, 64, 92, 74, 68, 78, 72, 77, 67, 73, 83, 69, 79, 84, 75, 88, 113, 183, 138, 149, 148
Offset: 1

Views

Author

Scott R. Shannon, Mar 12 2021

Keywords

Comments

No term can end in 0 or 1 as that would result in the last digit of a(n-1)*a(n) being the same as a(n)'s last digit. The majority of terms appear to grow linearly with n but occasional large spikes in the values also occur, e.g. a(47888) = 425956849. See the examples. It is unknown if the sequence is infinite.

Examples

			a(2) = 3 as a(1)*3 = 2*3 = 6 which shares no digit with a(1) = 2 or 3.
a(9) = 42 as a(8)*42 = 9*42 = 378 which shares no digit with a(8) = 9 or 42.
a(10) = 14 as a(9)*14 = 42*14 = 588 which shares no digit with a(9) = 42 or 14.
a(47888) = 425956849 as a(47887)*425956849 = 258649*425956849 = 110173313037001 which shares no digit with a(47887) = 258649 or 425956849.
		

Crossrefs

Programs

  • Python
    def aupton(terms):
      alst, aset = [2], {2}
      while len(alst) < terms:
        an, anm1_digs = 2, set(str(alst[-1]))
        while True:
          while an in aset: an += 1
          if (set(str(an)) | anm1_digs) & set(str(an*alst[-1])) == set():
            alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupton(74)) # Michael S. Branicky, Mar 20 2021

A239664 a(n) = 1, a(n+1) = smallest number not occurring earlier, having with a(n) neither a common digit nor a common divisor.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 23 2014

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (delete, intersect); import Data.Function (on)
    a239664 n = a239664_list !! (n-1)
    a239664_list = 1 : f 1 [2..] where
       f v ws = g ws where
         g (x:xs) = if gcd v x == 1 && ((intersect `on` show) v x == "")
                       then x : f x (delete x ws) else g xs
    
  • PARI
    {u=[]; a=1; for(n=1,99, print1(a","); u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1,u=u[^1]); for(k=u[1]+1,9e9, setsearch(u,k)&&next;gcd(k,a)>1&&next; #setintersect(Set(digits(a)),Set(digits(k)))&&next; a=k; next(2)));a} \\ M. F. Hasler, Sep 17 2016

A276512 a(n) = smallest integer not yet in the sequence with no digits in common with a(n-2); a(0)=0, a(1)=1.

Original entry on oeis.org

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

Views

Author

Zak Seidov and Eric Angelini, Sep 06 2016

Keywords

Comments

This is not a permutation of the nonnegative integers. E.g. 123456789 and 1023456789 (the smallest pandigital number) are not members.
a(n) = n for n = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 34, 84, 104, 105, 1449, 2889, 3183, ...

Crossrefs

Programs

  • Mathematica
    s={0,1};Do[a=s[[-2]];n=2; While[MemberQ[s,n]||Intersection [IntegerDigits[a],IntegerDigits[n]]≠{}, n++];AppendTo[s,n],{100}];s
  • Python
    from itertools import count, islice, product as P
    def only(s, D=1): # numbers with >= D digits only from s
        yield from (int("".join(p)) for d in count(D) for p in P(s, repeat=d))
    def agen(): # generator of terms
        aset, an1, an, minan = {0, 1}, 0, 1, 2
        yield from [0, 1]
        while True:
            an1, an, s = an, minan, set(str(an1))
            use = "".join(c for c in "0123456789" if c not in s)
            for an in only(use, D=len(str(minan))):
                if an not in aset: break
            aset.add(an)
            yield an
            while minan in aset: minan += 1
    print(list(islice(agen(), 75))) # Michael S. Branicky, Jun 30 2022

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

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

The sequence is finite, the 18351st term being a(18350) = 41987 beyond which no number exists that has not occurred earlier that has all distinct digits and that 41987*a(n) has all distinct digits. The maximum term is a(18097) = 219087.

Examples

			a(1) = 1 as 1 has one distinct digit and a(0)*1 = 0*1 = 0 which has one distinct digit 0.
a(10) = 10 as 10 has two distinct digits and a(9)*10 = 9*10 = 90 which has two distinct digits 9 and 0.
a(11) = 12 as 12 has two distinct digits and a(10)*12 = 10*12 = 120 which has three distinct digits. Note that 11 is the first skipped number as 11 has 1 as a duplicate digit.
a(16) = 19 as 19 has two distinct digits and a(15)*19 = 16*19 = 304 which has three distinct digits. Note that 17 and 18 are skipped as 16*17 = 272 while 16*18 = 288, both of which contain duplicate digits.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {0}, k, m = 42000}, Do[k = 1; While[Nand[FreeQ[a, k], AllTrue[DigitCount[a[[-1]]*k], # < 2 &], AllTrue[DigitCount[k], # < 2 &]], If[k > m, Break[]]; k++]; If[k > m, Break[]]; AppendTo[a, k], {i, 76}]; a] (* Michael De Vlieger, Mar 11 2021 *)

Extensions

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

A276766 a(n) = smallest nonnegative integer not yet in the sequence with no repeated digits and no digits in common with a(n-1), starting with a(0)=0.

Original entry on oeis.org

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

Views

Author

Claudio Meller, Sep 17 2016

Keywords

Comments

The author of this sequence is Rodolfo Kurchan, who mentioned this sequence in a Facebook Group "Series", cf. link.
The sequence is finite, with last term a(5274) = 78642. - M. F. Hasler, Sep 17 2016

Crossrefs

Programs

  • PARI
    {u=[]; (t(k)=if(#Set(k=digits(k))==#k,k)); a=1; for(n=1, 99, print1(a","); u=setunion(u, [a]); t(u[1])||u[1]++; while(#u>1&&u[2]<=u[1]+1, u=u[^1]); for(k=u[1]+1, 9e9, setsearch(u, k)&&next; (d=t(k))&& !#setintersect(Set(digits(a)), Set(d))&&(a=k)&&next(2))); a} \\ M. F. Hasler, Sep 17 2016
    
  • Python
    def ok(s, t): return len(set(t)) == len(t) and len(set(s+t)) == len(s+t)
    def agen(): # generator of complete sequence of terms
        aset, k, mink, MAX = {0}, 0, 1, 987654321
        while True:
            if k < MAX: yield k
            else: return
            k, s = mink, str(k)
            MAX = 10**(10-len(s))
            while k < MAX and (k in aset or not ok(s, str(k))):
                k += 1
            aset.add(k)
            while mink in aset: mink += 1
    print(list(agen())[:73]) # Michael S. Branicky, Jun 30 2022

Extensions

Edited by M. F. Hasler, Sep 17 2016

A342383 a(0) = 0; for n > 0, a(n) is the least positive integer not occurring earlier such that both the digits in a(n) and 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, 13, 12, 14, 15, 16, 18, 17, 19, 20, 21, 24, 23, 25, 26, 27, 29, 28, 30, 31, 32, 35, 34, 36, 37, 38, 40, 39, 41, 42, 43, 46, 45, 47, 48, 49, 53, 50, 52, 51, 54, 69, 56, 64, 59, 61, 62, 58, 65, 60, 63, 57, 67, 68, 70, 72, 71, 74, 73, 75, 78, 76, 80, 79, 81, 82, 83
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

The sequence is finite due to the finite number of positive integers with distinct digits, see A010784, although the exact number of terms is currently unknown.

Examples

			a(1) = 1 as 1 has one distinct digit and a(0)+1 = 0+1 = 1 which has one distinct digit 0.
a(6) = 7 as 7 has one distinct digit and a(5)+7 = 5+7 = 12 which has two distinct digits. Note that 6 is the first skipped number as a(5)+6 = 5+6 = 11 has 1 as a duplicate digit.
a(11) = 13 as 13 has two distinct digits and a(10)+13 = 10+13 = 23 which has two distinct digits. Note that 11 and 12 are skipped as 11 has 1 as a duplicate digit while a(10)+12 = 10+12 = 22 has 2 as a duplicate digit.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {0}, k, m = 10^4}, Do[k = 1; While[Nand[FreeQ[a, k], AllTrue[DigitCount[a[[-1]] + k], # < 2 &], AllTrue[DigitCount[k], # < 2 &]], If[k > m, Break[]]; k++]; If[k > m, Break[]]; AppendTo[a, k], {i, 76}]; a] (* Michael De Vlieger, Mar 11 2021 *)
  • Python
    def agen():
      alst, aset = [0], {0}
      yield 0
      while True:
        an = 1
        while True:
          while an in aset: an += 1
          stran, t = str(an), str(alst[-1] + an)
          if len(stran) == len(set(stran)) and len(t) == len(set(t)):
            alst.append(an); aset.add(an); yield an; break
          an += 1
    g = agen()
    print([next(g) for n in range(77)]) # Michael S. Branicky, Mar 11 2021
Showing 1-10 of 14 results. Next