%I #13 Feb 16 2025 08:33:27
%S 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,
%T 66,39,7,23,81,24,8,40,82,41,9,25,97,26,10,42,98,43,11,27,113,28,12,
%U 44,114,45,13,29,129,30,14,46,130,47,15,31,145,57,67,52,64
%N Lexicographically earliest sequence of distinct terms such that the hexadecimal representations of two consecutive terms overlap.
%C Suggested by Paul Tek's A262323;
%C two numbers are overlapping if a nonempty prefix of one equals a suffix of the other;
%C permutation of the natural numbers with inverse A262461.
%H Reinhard Zumkeller, <a href="/A262460/b262460.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Hexadecimal.html">Hexadecimal</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Hexadecimal">Hexadecimal</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e Table of initial terms: the HEX column gives the hexadecimal representation with aligned overlapping digits.
%e . n | a(n) | HEX n | a(n) | HEX n | a(n) | HEX
%e . ----+------+------- ----+------+------- ----+------+-------
%e . 1 | 1 | 1 25 | 38 | 26 49 | 44 | 2C
%e . 2 | 16 | 10 26 | 66 | 42 50 | 114 | 72
%e . 3 | 17 | 11 27 | 39 | 27 51 | 45 | 2D
%e . 4 | 18 | 12 28 | 7 | 7 52 | 13 | D
%e . 5 | 2 | 2 29 | 23 | 17 53 | 29 | 1D
%e . 6 | 32 | 20 30 | 81 | 51 54 | 129 | 81
%e . 7 | 34 | 22 31 | 24 | 18 55 | 30 | 1E
%e . 8 | 33 | 21 32 | 8 | 8 56 | 14 | E
%e . 9 | 19 | 13 33 | 40 | 28 57 | 46 | 2E
%e . 10 | 3 | 3 34 | 82 | 52 58 | 130 | 82
%e . 11 | 35 | 23 35 | 41 | 29 59 | 47 | 2F
%e . 12 | 48 | 30 36 | 9 | 9 60 | 15 | F
%e . 13 | 51 | 33 37 | 25 | 19 61 | 31 | 1F
%e . 14 | 49 | 31 38 | 97 | 61 62 | 145 | 91
%e . 15 | 20 | 14 39 | 26 | 1A 63 | 57 | 39
%e . 16 | 4 | 4 40 | 10 | A 64 | 67 | 43
%e . 17 | 36 | 24 41 | 42 | 2A 65 | 52 | 34
%e . 18 | 50 | 32 42 | 98 | 62 66 | 64 | 40
%e . 19 | 37 | 25 43 | 43 | 2B 67 | 68 | 44
%e . 20 | 5 | 5 44 | 11 | B 68 | 69 | 45
%e . 21 | 21 | 15 45 | 27 | 1B 69 | 80 | 50
%e . 22 | 65 | 41 46 | 113 | 71 70 | 53 | 35
%e . 23 | 22 | 16 47 | 28 | 1C 71 | 83 | 53
%e . 24 | 6 | 6 48 | 12 | C 72 | 54 | 36
%o (Haskell)
%o import Data.List (inits, tails, intersect, delete, genericIndex)
%o a262460 n = genericIndex a262460_list (n - 1)
%o a262460_list = 1 : f [1] (drop 2 a262437_tabf) where
%o f xs tss = g tss where
%o g (ys:yss) | null (intersect its $ tail $ inits ys) &&
%o null (intersect tis $ init $ tails ys) = g yss
%o | otherwise = (foldr (\t v -> 16 * v + t) 0 ys) :
%o f ys (delete ys tss)
%o its = init $ tails xs; tis = tail $ inits xs
%Y Cf. A262323, A262411, A262437, A262461 (inverse).
%K nonn,base,changed
%O 1,2
%A _Reinhard Zumkeller_, Sep 23 2015