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.

A262411 Lexicographically earliest sequence of distinct terms such that the ternary representations of two consecutive terms overlap.

This page as a plain text file.
%I A262411 #14 Dec 11 2015 21:54:15
%S A262411 1,3,4,5,2,6,8,7,9,10,11,12,13,14,15,16,17,18,20,19,23,21,25,22,26,24,
%T A262411 29,28,27,30,31,32,34,33,37,35,38,39,36,40,41,42,43,44,46,45,49,47,50,
%U A262411 48,52,51,54,53,55,56,57,59,58,60,61,62,63,65,64,68,66
%N A262411 Lexicographically earliest sequence of distinct terms such that the ternary representations of two consecutive terms overlap.
%C A262411 Suggested by Paul Tek's A262323;
%C A262411 two numbers are overlapping if a nonempty prefix of one equals a suffix of the other;
%C A262411 permutation of the natural numbers with inverse A262429;
%C A262411 A262412(n) = A007089(a(n)).
%H A262411 Reinhard Zumkeller, <a href="/A262411/b262411.txt">Table of n, a(n) for n = 1..10000</a>
%H A262411 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e A262411 .   n | a(n) | A262412(n)           n | a(n) | A262412(n)
%e A262411 . ----+------+-----------         ----+------+-------------
%e A262411 .                                 (25 |   26 |         222 )
%e A262411 .   1 |    1 |   1                 26 |   24 |          220
%e A262411 .   2 |    3 |   10                27 |   29 |       1002
%e A262411 .   3 |    4 |  11                 28 |   28 |    1001
%e A262411 .   4 |    5 |   12                29 |   27 |       1000
%e A262411 .   5 |    2 |    2                30 |   30 |     1010
%e A262411 .   6 |    6 |    20               31 |   31 |  1011
%e A262411 .   7 |    8 |   22                32 |   32 |     1012
%e A262411 .   8 |    7 |    21               33 |   34 |  1021
%e A262411 .   9 |    9 |     100             34 |   33 |     1020
%e A262411 .  10 |   10 |   101               35 |   37 |  1101
%e A262411 .  11 |   11 |     102             36 |   35 |     1022
%e A262411 .  12 |   12 |    110              37 |   38 |    1102
%e A262411 .  13 |   13 |   111               38 |   39 |   1110
%e A262411 .  14 |   14 |    112              39 |   36 |    1100
%e A262411 .  15 |   15 |     120             40 |   40 |  1111
%e A262411 .  16 |   16 |   121               41 |   41 |   1112
%e A262411 .  17 |   17 |     122             42 |   42 |    1120
%e A262411 .  18 |   18 |       200           43 |   43 | 1121
%e A262411 .  19 |   20 |     202             44 |   44 |    1122
%e A262411 .  20 |   19 |       201           45 |   46 | 1201
%e A262411 .  21 |   23 |     212             46 |   45 |    1200
%e A262411 .  22 |   21 |       210           47 |   49 | 1211
%e A262411 .  23 |   25 |      221            48 |   47 |    1202
%e A262411 .  24 |   22 |       211           49 |   50 |  1212
%e A262411 .  25 |   26 |     222             50 |   48 |    1210  .
%e A262411 . (26 |   24 |      220 )
%o A262411 (Haskell)
%o A262411 import Data.List (inits, tails, intersect, delete, genericIndex)
%o A262411 a262411 n = genericIndex a262411_list (n - 1)
%o A262411 a262411_list = 1 : f [1] (drop 2 a030341_tabf) where
%o A262411    f xs tss = g tss where
%o A262411      g (ys:yss) | null (intersect its $ tail $ inits ys) &&
%o A262411                   null (intersect tis $ init $ tails ys) = g yss
%o A262411                 | otherwise = (foldr (\t v -> 3 * v + t) 0 ys) :
%o A262411                               f ys (delete ys tss)
%o A262411      its = init $ tails xs; tis = tail $ inits xs
%Y A262411 Cf. A262323, A030341, A007089, A262412 (ternary conversion), A262429 (inverse), A262435 (fixed points).
%Y A262411 Cf. A262460.
%K A262411 nonn,base
%O A262411 1,2
%A A262411 _Reinhard Zumkeller_, Sep 22 2015