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 16 results. Next

A227118 Inverse permutation to A184992.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 01 2013

Keywords

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a227118 = (+ 1) . fromJust . (`elemIndex` a184992_list)

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

A249591 Lexicographically earliest permutation of the integers such that a(n+1) shares at least one digit with a(n)-1.

Original entry on oeis.org

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

Views

Author

Eric Angelini and M. F. Hasler, Nov 01 2014

Keywords

Crossrefs

Cf. A249585.
Cf. A184992.

Programs

  • Haskell
    import Data.List (intersect, delete)
    a249591 n = a249591_list !! (n-1)
    a249591_list = 1 : f 1 [2..] where
       f x zs = g zs where
         g (y:ys) = if null $ show y `intersect` show (x - 1)
                       then g ys else y : f y (delete y zs)
    -- Reinhard Zumkeller, Nov 02 2014
  • PARI
    {u=0; a=1; for(n=1, 99, print1(a","); u+=1<1,digits(a-1))); for(k=2, 9e9, bittest(u, k)&&next; #setintersect(D, Set(digits(k)))||next; a=k; break))}
    

A246946 a(1)=6; for n > 1, a(n) is the least integer not occurring earlier such that a(n) shares exactly two distinct prime divisors with a(n-1).

Original entry on oeis.org

6, 12, 18, 24, 30, 10, 20, 40, 50, 60, 15, 45, 75, 90, 36, 42, 14, 28, 56, 70, 35, 105, 21, 63, 84, 48, 54, 66, 22, 44, 88, 110, 55, 165, 33, 99, 132, 72, 78, 26, 52, 104, 130, 65, 195, 39, 117, 156, 96, 102, 34, 68, 136, 170, 80, 100, 120, 108, 114, 38, 76
Offset: 1

Views

Author

Michel Lagneau, Sep 08 2014

Keywords

Comments

All terms belong to A024619. Is this a permutation of A024619? - Michel Marcus, Nov 23 2015

Examples

			18 is in the sequence because the common prime distinct divisors between a(2)=12 and a(3)=18 are 2 and 3.
		

Crossrefs

Programs

  • Maple
    with(numtheory):a0:={2,3}:lst:={}:
    for n from 6 to 100 do:
      ii:=0:
        for k from 3 to 50000 while(ii=0) do:
          y:=factorset(k):n0:=nops(y):lst1:={}:
            for j from 1 to n0 do:
            lst1:=lst1 union {y[j]}:
            od:
             a1:=a0 intersect lst1:
             if {k} intersect lst ={} and a1 <> {} and nops(a1)=2
              then
              printf(`%d, `,k):lst:=lst union {k}:a0:=lst1:ii:=1:
             else
             fi:
          od:
      od:
  • Mathematica
    f[s_List]:=Block[{m=s[[-1]],k=6},While[MemberQ[s,k]||Intersection[Transpose[FactorInteger[k]][[1]],Transpose[FactorInteger[m]][[1]]]=={}|| Length[Intersection[Transpose[FactorInteger[k]][[1]],Transpose[FactorInteger[m]][[1]]]]!=2,k++];Append[s,k]];Nest[f,{6},71]
  • PARI
    lista(nn) = {a = 6; print1(a, ", "); fa = (factor(a)[,1])~; va = [a]; k = 0; while (k != nn, k = 1; while (!((#setintersect(fa, (factor(k)[,1])~) == 2) && (! vecsearch(va, k))), k++); a = k; print1(a, ", "); fa = (factor(a)[,1])~; va = vecsort(concat(va, k)););} \\ Michel Marcus, Nov 23 2015

A286890 a(n) is the least positive integer not yet in the sequence that shares its largest digit with that of a(n-1); a(1)=1.

Original entry on oeis.org

1, 10, 11, 12, 2, 20, 21, 22, 23, 3, 13, 30, 31, 32, 33, 34, 4, 14, 24, 40, 41, 42, 43, 44, 45, 5, 15, 25, 35, 50, 51, 52, 53, 54, 55, 56, 6, 16, 26, 36, 46, 60, 61, 62, 63, 64, 65, 66, 67, 7, 17, 27, 37, 47, 57, 70, 71, 72, 73, 74, 75, 76, 77, 78, 8, 18, 28, 38, 48, 58, 68, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 19, 29, 39, 49, 59, 69, 79, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 109, 119, 129
Offset: 1

Views

Author

Enrique Navarrete, Jul 22 2017

Keywords

Comments

After a(81) = 89, each term must contain a 9.
Unlike A184992, not a permutation of the positive integers, but contains all numbers from 1 to 99.

Examples

			Gathering intervals of consecutive integers, sequence begins as follows:
1,                               10..12,
2,                               20..23,
3, 13,                           30..34,
4, 14, 24,                       40..45,
5, 15, 25, 35,                   50..56,
6, 16, 26, 36, 46,               60..67,
7, 17, 27, 37, 47, 57,           70..78,
8, 18, 28, 38, 48, 58, 68,       80..89,
9, 19, 29, 39, 49, 59, 69, 79,   90..99,
109, 119, 129, ...
		

Crossrefs

Cf. A184992.

Programs

  • Mathematica
    a = {1}; Do[k = 2; While[Nand[! MemberQ[a, k], MemberQ[IntegerDigits[k], Max@ IntegerDigits[a[[n - 1]] ]]], k++]; AppendTo[a, k], {n, 2, 102}]; a (* Michael De Vlieger, Jul 22 2017 *)

A227113 Lexicographically earliest permutation of the natural numbers such that all pairs of even- and odd-indexed terms have a common divisor > 1.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 01 2013

Keywords

Comments

a(2*n) = smallest number not occurring earlier;
a(2*n+1) = smallest number having with a(2*n) a common divisor greater than 1 and not occurring earlier;
A227288(n) = gcd(a(n), a(n+1)).

Examples

			.   n | a(2n) a(2n+1) | GCD |         not occurring after step n
.  ---+---------------+-----+-------------------------------------------
.   0 |    _      1   |   _ |  {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,..}
.   1 |    2      4   |   2 |  {3,5,6,7,8,9,10,11,12,13,14,15,16,17,..}
.   2 |    3      6   |   3 |  {5,7,8,9,10,11,12,13,14,15,16,17,18,19,..}
.   3 |    5     10   |   5 |  {7,8,9,11,12,13,14,15,16,17,18,19,20,..}
.   4 |    7     14   |   7 |  {8,9,11,12,13,15,16,17,18,19,20,21,22,..}
.   5 |    8     12   |   4 |  {9,11,13,15,16,17,18,19,20,21,22,23,24..}
.   6 |    9     15   |   3 |  {11,13,16,17,18,19,20,21,22,23,24,25,..}
.   7 |   11     22   |  11 |  {13,16,17,18,19,20,21,23,24,25,26,27,..}
.   8 |   13     26   |  11 |  {16,17,18,19,20,21,23,24,25,27,28,29,..}
.   9 |   16     18   |   2 |  {17,19,20,21,23,24,25,27,28,29,30,31,..} .
		

Crossrefs

Cf. A227114 (inverse).

Programs

  • Haskell
    import Data.List (delete)
    a227113 n = a227113_list !! (n-1)
    a227113_list = 1 : f [2..] where
       f (x:xs) = x : y : f (delete y xs)
         where y : _ = filter ((> 1) . (gcd x)) xs

Extensions

Thanks to Zak Seidov (who suggested more elaboration) from Reinhard Zumkeller, Jul 05 2013

A342356 a(1) = 1, a(2) = 10; for n > 2, a(n) is the least positive integer not occurring earlier that shares both a factor and a digit with a(n-1).

Original entry on oeis.org

1, 10, 12, 2, 20, 22, 24, 4, 14, 16, 6, 26, 28, 8, 18, 15, 5, 25, 35, 30, 3, 33, 36, 32, 34, 38, 48, 40, 42, 21, 27, 57, 45, 50, 52, 54, 44, 46, 56, 58, 68, 60, 62, 64, 66, 63, 39, 9, 69, 90, 70, 7, 77, 147, 49, 84, 74, 37, 333, 93, 31, 124, 72, 75, 51, 17, 102, 80, 78, 76, 86, 82, 88, 98, 91
Offset: 1

Views

Author

Scott R. Shannon, Mar 08 2021

Keywords

Comments

After 100000 terms the lowest unused number is 18181. The sequence is likely a permutation of the positive integers.

Crossrefs

Cf. A342366 (share factor but not digit), A239664 (no shared factor or digit), A342367 (share digit but not factor), A184992, A309151, A249591.

Programs

  • Mathematica
    Block[{a = {1, 10}, m = {1, 0}, k}, Do[k = 2; While[Nand[FreeQ[a, k], GCD[k, a[[-1]]] > 1, IntersectingQ[m, IntegerDigits[k]]], k++]; AppendTo[a, k]; Set[m, IntegerDigits[k]], {i, 73}]; a] (* Michael De Vlieger, Mar 11 2021 *)
  • Python
    from sympy import factorint
    def aupton(terms):
      alst, aset = [1, 10], {1, 10}
      for n in range(3, terms+1):
        an = 1
        anm1_digs, anm1_factors = set(str(alst[-1])), set(factorint(alst[-1]))
        while True:
          while an in aset: an += 1
          if set(str(an)) & anm1_digs != set():
            if set(factorint(an)) & anm1_factors != set():
              alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupton(75)) # Michael S. Branicky, Mar 09 2021

A342366 a(1) = 1, a(2) = 2; for n > 2, a(n) is the least positive integer not occurring earlier that shares a factor but not a digit with a(n-1).

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 8, 10, 5, 20, 14, 7, 21, 30, 15, 24, 16, 22, 11, 33, 18, 26, 13, 52, 34, 17, 68, 32, 40, 25, 60, 27, 36, 28, 35, 42, 38, 19, 57, 39, 45, 63, 48, 50, 44, 55, 66, 51, 69, 23, 46, 58, 29, 87, 54, 62, 31, 248, 56, 49, 70, 64, 72, 80, 65, 78, 90, 74, 82, 41, 205, 164, 88, 76, 84
Offset: 1

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

After 100000 terms the lowest unused number is 1523. It is unknown if the sequence is a permutation of the positive integers.

Crossrefs

Cf. A342356 (share factor and digit), A239664 (no shared factor or digit), A342367 (share digit but not factor), A184992, A309151, A249591.

Programs

  • Mathematica
    Block[{a = {1, 2}, m = {2}, k}, Do[k = 2; While[Nand[FreeQ[a, k], GCD[k, a[[-1]]] > 1, ! IntersectingQ[m, IntegerDigits[k]]], k++]; AppendTo[a, k]; Set[m, IntegerDigits[k]], {i, 74}]; a] (* Michael De Vlieger, Mar 11 2021 *)
  • Python
    from sympy import factorint
    def aupton(terms):
      alst, aset = [1, 2], {1, 2}
      for n in range(3, terms+1):
        an = 1
        anm1_digs, anm1_factors = set(str(alst[-1])), set(factorint(alst[-1]))
        while True:
          while an in aset: an += 1
          if set(str(an)) & anm1_digs == set():
            if set(factorint(an)) & anm1_factors != set():
              alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupton(76)) # Michael S. Branicky, Mar 09 2021

A342367 a(1) = 1; for n > 1, a(n) is the least positive integer not occurring earlier that shares a digit but not a factor > 1 with a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

After 100000 terms the lowest unused number is 99986. It is almost certain that this sequence is a permutation of the positive integers.

Crossrefs

Cf. A342356 (share factor and digit), A342366 (share factor but not digit), A239664 (no shared factor or digit), A184992, A309151, A249591.

Programs

  • Mathematica
    Block[{a = {1}, m = {1}, k}, Do[k = 2; While[Nand[FreeQ[a, k], GCD[k, a[[-1]]] == 1, IntersectingQ[m, IntegerDigits[k]]], k++]; AppendTo[a, k]; Set[m, IntegerDigits[k]], {i, 74}]; a] (* Michael De Vlieger, Mar 11 2021 *)
  • Python
    from sympy import factorint
    def aupton(terms):
      alst, aset = [1], {1}
      for n in range(2, terms+1):
        an = 1
        anm1_digs, anm1_factors = set(str(alst[-1])), set(factorint(alst[-1]))
        while True:
          while an in aset: an += 1
          if set(str(an)) & anm1_digs != set():
            if set(factorint(an)) & anm1_factors == set():
              alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupton(74)) # Michael S. Branicky, Mar 09 2021

A245281 a(1)=2; for n > 1, a(n) is the least positive integer not occurring earlier that shares a digit and a factor with a(n-1).

Original entry on oeis.org

2, 12, 10, 14, 4, 24, 20, 22, 26, 6, 16, 18, 8, 28, 21, 15, 5, 25, 35, 30, 3, 33, 36, 32, 34, 38, 48, 40, 42, 27, 57, 45, 50, 52, 54, 44, 46, 56, 58, 68, 60, 62, 64, 66, 63, 39, 9, 69, 90, 70, 7, 77, 147, 49, 84, 74, 37, 333, 93, 31, 124, 72, 75, 51, 17, 102
Offset: 1

Views

Author

Michel Lagneau, Sep 06 2014

Keywords

Comments

Is this a permutation of the integers >= 2? # Robert Israel, Sep 07 2014

Examples

			a(16)=15 because GCD(a(16),a(15)) = GCD(15,21) = 3 and 1 is the common digit of 15 and 16.
		

Crossrefs

Programs

  • Maple
    S:= {2}:
    A[1]:= 2:
    L[1]:= {2}:
    for n from 2 to 1000 do
      k:= 0;
      mS:= max(S);
      Sp:= {$2..mS} minus S;
      do
         if Sp <> {} then
            k:= min(Sp);
            Sp:= Sp minus {k};
         elif k < mS then k:= mS+1
         else k:= k+1
         fi;
         if member(k,S) or igcd(k,A[n-1]) = 1 then next fi;
         Lk:= convert(convert(k,base,10),set);
         if Lk intersect L[n-1] <> {} then
            A[n]:= k;
            L[n]:= Lk;
            S:= S union {k};
            break
         fi
      od:
    od:
    seq(A[n],n=1..1000); # Robert Israel, Sep 07 2014
  • Mathematica
    f[s_List]:=Block[{m=s[[-1]],k=2},While[MemberQ[s,k]||Intersection[IntegerDigits[k],IntegerDigits[m]]=={}||GCD[m,k]==1,k++];Append[s,k]];Nest[f,{2},71]
Showing 1-10 of 16 results. Next