login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A278985 List of words of length n over an alphabet of size 3 that are in standard order. 3
1, 11, 12, 111, 112, 121, 122, 123, 1111, 1112, 1121, 1122, 1123, 1211, 1212, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 11111, 11112, 11121, 11122, 11123, 11211, 11212, 11213, 11221, 11222, 11223, 11231, 11232, 11233, 12111, 12112, 12113, 12121, 12122 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
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.
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.
These are the words described in row b=3 of the array in A278984.
A007051(n-1) gives the number of n-digit terms in this sequence. - Rémy Sigrist, Dec 18 2016
LINKS
Rémy Sigrist and N. J. A. Sloane, Table of n, a(n) for n = 1..14767 [Terms 1 through 185 by N. J. A. Sloane]
Joerg Arndt and N. J. A. Sloane, Counting Words that are in "Standard Order"
MAPLE
b:= proc(n) option remember; `if`(n=1, [[1]], map(x->
seq([x[], i], i=1..min(3, max(x[])+1)), b(n-1)))
end:
T:= n-> map(x-> parse(cat(x[])), b(n))[]:
seq(T(n), n=1..5); # Alois P. Heinz, Jan 02 2022
MATHEMATICA
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 *)
PROG
(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))))
for (len=1, 5, gen(0, len, 0)) \\ Rémy Sigrist, Dec 18 2016
CROSSREFS
Similar to but different from A071159.
Sequence in context: A239463 A153070 A193023 * A071159 A231873 A096299
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Dec 05 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)