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.
%I A278985 #28 Jan 02 2022 18:21:23 %S A278985 1,11,12,111,112,121,122,123,1111,1112,1121,1122,1123,1211,1212,1213, %T A278985 1221,1222,1223,1231,1232,1233,11111,11112,11121,11122,11123,11211, %U A278985 11212,11213,11221,11222,11223,11231,11232,11233,12111,12112,12113,12121,12122 %N A278985 List of words of length n over an alphabet of size 3 that are in standard order. %C A278985 We study words made of letters from an alphabet of size b, where b >= 1. We assume the letters are labeled {1,2,3,...,b}. There are b^n possible words of length n. %C A278985 We say that a word is in "standard order" if it has the property that whenever a letter i appears, the letter i-1 has already appeared in the word. This implies that all words begin with the letter 1. %C A278985 These are the words described in row b=3 of the array in A278984. %C A278985 A007051(n-1) gives the number of n-digit terms in this sequence. - _Rémy Sigrist_, Dec 18 2016 %H A278985 Rémy Sigrist and N. J. A. Sloane, <a href="/A278985/b278985.txt">Table of n, a(n) for n = 1..14767</a> [Terms 1 through 185 by N. J. A. Sloane] %H A278985 Joerg Arndt and N. J. A. Sloane, <a href="/A278984/a278984.txt">Counting Words that are in "Standard Order"</a> %p A278985 b:= proc(n) option remember; `if`(n=1, [[1]], map(x-> %p A278985 seq([x[], i], i=1..min(3, max(x[])+1)), b(n-1))) %p A278985 end: %p A278985 T:= n-> map(x-> parse(cat(x[])), b(n))[]: %p A278985 seq(T(n), n=1..5); # _Alois P. Heinz_, Jan 02 2022 %t A278985 Table[FromDigits /@ Select[Tuples[Range@ 3, n], And[Times @@ Boole@ MapIndexed[#1 <= First@ #2 &, #] > 0, Max@ Differences@ # <= 1] &], {n, 5}] // Flatten (* _Michael De Vlieger_, Dec 18 2016 *) %o A278985 (PARI) gen(n, len, mx) = if (len==0, print1 (n ", "), for (d=1, min(mx+1, 3), gen(10*n + d, len-1, max(mx, d)))) %o A278985 for (len=1, 5, gen(0, len, 0)) \\ _Rémy Sigrist_, Dec 18 2016 %Y A278985 Cf. A278984, A007051. %Y A278985 Similar to but different from A071159. %K A278985 nonn,base %O A278985 1,2 %A A278985 _N. J. A. Sloane_, Dec 05 2016