login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A206701 The number of words of length n created with the letters a,b,c with at least as many a's as b's and at least as many b's as c's and no adjacent letters forming the pattern aba and no subwords (any non adjacent subsequence of letters) of the form cbc. 2
1, 1, 3, 9, 17, 46, 114, 262, 574, 1427, 2927, 6603, 14404, 30565, 63613, 138813, 280318, 587475, 1218642, 2483850, 5029611, 10412477, 20733046, 42016631, 84910771, 169447050, 337521488, 680231390, 1340806837, 2667729672, 5306731496, 10458274889, 20608397551 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..200

EXAMPLE

a(0) = 1: "".

a(1) = 1: "a".

a(2) = 3: "aa", "ab", "ba".

a(3) = 9: "aaa", "aab", "abc", "acb", "baa", "bac", "bca", "cab", "cba".

MAPLE

a:= n-> add (add (w (na, nb, n-na-nb, 0, 0),

        nb=ceil((n-na)/2)..min(n-na, na)), na=ceil(n/3)..n):

w:= proc(a, b, c, x, y) option remember;

      `if`([a, b, c]=[0$3], 1, `if`(a>0 and x<>2, w(a-1, b, c, 1, y), 0)+

      `if`(b>0, w(a, b-1, c, `if`(x=1, 2, 0), `if`(y>0, 2, 0)), 0)+

      `if`(c>0 and y<>2, w(a, b, c-1, 0, 1), 0))

    end:

seq (a(n), n=0..40);  # Alois P. Heinz, May 21 2012

PROG

sage:  def myavoids(w):

....:  v = w.count(2)

....:  if w.count(1)<v or v<w.count(3):

....:     return False

....:    return Word([1, 2, 1]).nb_factor_occurrences_in(w)

==0 and Word([3, 2, 3]).nb_subword_occurrences_in(w)==0

....:

sage: for n in range(30):

....: print Words(3, length=n).filter(myavoids).cardinality()

CROSSREFS

Cf. A176148, A176354.

Sequence in context: A011755 A128301 A176148 * A176354 A210337 A173140

Adjacent sequences:  A206698 A206699 A206700 * A206702 A206703 A206704

KEYWORD

nonn

AUTHOR

Grazia Barone, Feb 11 2012

EXTENSIONS

Extended beyond a(15) by Alois P. Heinz, May 21 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 20 04:38 EDT 2013. Contains 225447 sequences.