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

A262429 Inverse permutation to A262411.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Crossrefs

Cf. A262411, A262435 (fixed points).

Programs

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

A262435 Fixed points of permutations A262411 and A262429.

Original entry on oeis.org

1, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 28, 30, 31, 32, 40, 41, 42, 43, 44, 55, 56, 57, 60, 61, 62, 63, 79, 81, 82, 83, 84, 85, 86, 91, 92, 93, 94, 95, 119, 121, 122, 123, 124, 125, 167, 168, 169, 170, 171, 189, 246, 247, 248, 253, 254, 255, 256, 257
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Crossrefs

Programs

  • Haskell
    a262435 n = a262435_list !! (n-1)
    a262435_list = [x | x <- [1..], a262411 x == x]

A262412 A262411 in ternary representation.

Original entry on oeis.org

1, 10, 11, 12, 2, 20, 22, 21, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, 202, 201, 212, 210, 221, 211, 222, 220, 1002, 1001, 1000, 1010, 1011, 1012, 1021, 1020, 1101, 1022, 1102, 1110, 1100, 1111, 1112, 1120, 1121, 1122, 1201, 1200, 1211, 1202, 1212
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Comments

a(n) = A007089(A262411(n)).

Examples

			See A262411.
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails, intersect, delete)
    a262412 n = a262412_list !! (n - 1)
    a262412_list = 1 : f [1] (drop 2 a030341_tabf) where
       f xs tss = g tss where
         g (ys:yss) | null (intersect its $ tail $ inits ys) &&
                      null (intersect tis $ init $ tails ys) = g yss
                    | otherwise = (foldr (\t v -> 10 * v + t) 0 ys) :
                                  f ys (delete ys tss)
         its = init $ tails xs; tis = tail $ inits xs
    -- Reinhard Zumkeller, Sep 22 2015

A262323 Lexicographically earliest sequence of distinct terms such that the decimal representations of two consecutive terms overlap.

Original entry on oeis.org

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

Views

Author

Paul Tek, Sep 19 2015

Keywords

Comments

Two terms are said to overlap:
- if the decimal representation of one term is contained in the decimal representation of the other term (for example, 12 and 2 overlap),
- or if, for some k>0, the first k decimal digits (without leading zero) of one term correspond to the k last decimal digits of the other term (for example, 1017 and 1101 overlap).
This sequence is a permutation of the positive integers, with inverse A262255.
The first overlap involving 1 digit occurs between a(1)=1 and a(2)=10.
The first overlap involving 2 digits occurs between a(108)=100 and a(109)=110.
The first overlap involving 3 digits occurs between a(1039)=1017 and a(1040)=1101.
The first overlap involving 4 digits occurs between a(10584)=10212 and a(10585)=11021.

Examples

			The first terms of the sequence are:
+----+---------+
| n  | a(n)    |
+----+---------+
|  1 |  1      |
|  2 |  10     |
|  3 | 11      |
|  4 |  12     |
|  5 |   2     |
|  6 |   20    |
|  7 |  22     |
|  8 |   21    |
|  9 |    13   |
| 10 |     3   |
| 11 |    23   |
| 12 |     30  |
| 13 |    33   |
| 14 |     31  |
| 15 |      14 |
| 16 |       4 |
| 17 |      24 |
| 18 |     32  |
| 19 |      25 |
| 20 |       5 |
+----+---------+
		

Crossrefs

Cf. A262367 (fixed points), A262411 (ternary version), A262460 (hexadecimal version).

Programs

  • Haskell
    import Data.List (inits, tails, intersect, delete)
    a262323 n = a262323_list !! (n-1)
    a262323_list = 1 : f "1" (map show [2..]) where
       f xs zss = g zss where
         g (ys:yss) | null (intersect its $ tail $ inits ys) &&
                      null (intersect tis $ init $ tails ys) = g yss
                    | otherwise = (read ys :: Int) : f ys (delete ys zss)
         its = init $ tails xs; tis = tail $ inits xs
    -- Reinhard Zumkeller, Sep 21 2015
    
  • Perl
    See Links section.
    
  • Python
    def overlaps(a, b):
      s, t = sorted([str(a), str(b)], key = lambda x: len(x))
      if any(t.startswith(s[i:]) for i in range(len(s))): return True
      return any(t.endswith(s[:i]) for i in range(1, len(s)+1))
    def aupto(nn):
      alst, aset = [1], {1}
      for n in range(2, nn+1):
        an = 1
        while True:
          while an in aset: an += 1
          if overlaps(an, alst[-1]): alst.append(an); aset.add(an); break
          an += 1
      return alst
    print(aupto(67)) # Michael S. Branicky, Jan 10 2021

A262460 Lexicographically earliest sequence of distinct terms such that the hexadecimal representations of two consecutive terms overlap.

Original entry on oeis.org

1, 16, 17, 18, 2, 32, 34, 33, 19, 3, 35, 48, 51, 49, 20, 4, 36, 50, 37, 5, 21, 65, 22, 6, 38, 66, 39, 7, 23, 81, 24, 8, 40, 82, 41, 9, 25, 97, 26, 10, 42, 98, 43, 11, 27, 113, 28, 12, 44, 114, 45, 13, 29, 129, 30, 14, 46, 130, 47, 15, 31, 145, 57, 67, 52, 64
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 23 2015

Keywords

Comments

Suggested by Paul Tek's A262323;
two numbers are overlapping if a nonempty prefix of one equals a suffix of the other;
permutation of the natural numbers with inverse A262461.

Examples

			Table of initial terms: the HEX column gives the hexadecimal representation with aligned overlapping digits.
.   n | a(n) | HEX          n | a(n) | HEX          n | a(n) | HEX
. ----+------+-------     ----+------+-------     ----+------+-------
.   1 |    1 |  1          25 |   38 |   26        49 |   44 |    2C
.   2 |   16 |  10         26 |   66 |  42         50 |  114 |   72
.   3 |   17 | 11          27 |   39 |   27        51 |   45 |    2D
.   4 |   18 |  12         28 |    7 |    7        52 |   13 |     D
.   5 |    2 |   2         29 |   23 |   17        53 |   29 |    1D
.   6 |   32 |   20        30 |   81 |  51         54 |  129 |   81
.   7 |   34 |  22         31 |   24 |   18        55 |   30 |    1E
.   8 |   33 |   21        32 |    8 |    8        56 |   14 |     E
.   9 |   19 |    13       33 |   40 |   28        57 |   46 |    2E
.  10 |    3 |     3       34 |   82 |  52         58 |  130 |   82
.  11 |   35 |    23       35 |   41 |   29        59 |   47 |    2F
.  12 |   48 |     30      36 |    9 |    9        60 |   15 |     F
.  13 |   51 |    33       37 |   25 |   19        61 |   31 |    1F
.  14 |   49 |     31      38 |   97 |  61         62 |  145 |   91
.  15 |   20 |      14     39 |   26 |   1A        63 |   57 |  39
.  16 |    4 |       4     40 |   10 |    A        64 |   67 | 43
.  17 |   36 |      24     41 |   42 |   2A        65 |   52 |  34
.  18 |   50 |     32      42 |   98 |  62         66 |   64 |   40
.  19 |   37 |      25     43 |   43 |   2B        67 |   68 |  44
.  20 |    5 |       5     44 |   11 |    B        68 |   69 |   45
.  21 |   21 |      15     45 |   27 |   1B        69 |   80 |    50
.  22 |   65 |     41      46 |  113 |  71         70 |   53 |   35
.  23 |   22 |      16     47 |   28 |   1C        71 |   83 |    53
.  24 |    6 |       6     48 |   12 |    C        72 |   54 |     36
		

Crossrefs

Cf. A262323, A262411, A262437, A262461 (inverse).

Programs

  • Haskell
    import Data.List (inits, tails, intersect, delete, genericIndex)
    a262460 n = genericIndex a262460_list (n - 1)
    a262460_list = 1 : f [1] (drop 2 a262437_tabf) where
       f xs tss = g tss where
         g (ys:yss) | null (intersect its $ tail $ inits ys) &&
                      null (intersect tis $ init $ tails ys) = g yss
                    | otherwise = (foldr (\t v -> 16 * v + t) 0 ys) :
                                  f ys (delete ys tss)
         its = init $ tails xs; tis = tail $ inits xs

A262461 Inverse permutation to A262460.

Original entry on oeis.org

1, 5, 10, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 2, 3, 4, 9, 15, 21, 23, 29, 31, 37, 39, 45, 47, 53, 55, 61, 6, 8, 7, 11, 17, 19, 25, 27, 33, 35, 41, 43, 49, 51, 57, 59, 12, 14, 18, 13, 65, 70, 72, 80, 82, 63, 84, 86, 88, 90, 92, 94, 66, 22, 26, 64
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 23 2015

Keywords

Crossrefs

Cf. A262411.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a262461 = (+ 1) . fromJust . (`elemIndex` a262460_list)
Showing 1-6 of 6 results.