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.

A194850 Number of prefix normal words of length n.

Original entry on oeis.org

2, 3, 5, 8, 14, 23, 41, 70, 125, 218, 395, 697, 1273, 2279, 4185, 7568, 13997, 25500, 47414, 87024, 162456, 299947, 562345, 1043212, 1962589, 3657530, 6900717, 12910042, 24427486, 45850670, 86970163, 163756708, 311283363, 587739559, 1119581278, 2119042830
Offset: 1

Views

Author

Gabriele Fici, Sep 04 2011

Keywords

Comments

A binary word of length n is prefix normal if for all 1 <= k <= n, no factor of length k has more a's than the prefix of length k. That is, abbabab is not prefix normal because aba has more a's than abb. - Zsuzsanna Liptak, Oct 12 2011
a(n) <= A062692(n): every prefix normal word is a pre-necklace, but the converse is not true, see the Fici/Lipták reference. - Joerg Arndt, Jul 20 2013

Examples

			For n=3: aaa, aab, abb, aba, bbb are all prefix normal words. - _Zsuzsanna Liptak_, Oct 12 2011
		

Crossrefs

Cf. A062692 (binary pre-necklaces).
See A238109 for a list of the prefix-normal words.

Programs

  • Python
    from itertools import product
    def is_prefix_normal(w):
      for k in range(1, len(w)+1):
        weight0 = w[:k].count("1")
        for j in range(1, len(w)-k+1):
          weightj = w[j:j+k].count("1")
          if weightj > weight0: return False
      return True
    def a(n):
      return sum(is_prefix_normal(w) for w in product("01", repeat=n))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Dec 19 2020

Extensions

More terms added by Zsuzsanna Liptak, Oct 12 2011
Further terms added by Zsuzsanna Liptak, Jan 29 2014