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.

Showing 1-3 of 3 results.

A285894 Number of length-n binary sequences whose subword complexity is <= 2i, for all i.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 472, 856, 1494, 2494, 4060, 6460, 10002, 15170, 22492, 32596, 46824, 66076, 91716, 125784, 170582, 227426, 302210, 396144, 514540, 663740, 850580, 1078628, 1362312
Offset: 0

Views

Author

Jeffrey Shallit, Apr 28 2017

Keywords

Comments

The subword complexity of a finite or infinite sequence i is the function sending i to the number of distinct length-i blocks appearing in s.

Crossrefs

Cf. A260881, which counts the same thing for subword complexity <= i+1 instead of <= 2i.

A291365 Number of closed Sturmian words of length n.

Original entry on oeis.org

2, 2, 4, 6, 12, 16, 26, 36, 52, 64, 86, 108, 142, 170, 206, 242, 294, 340, 404, 468, 544, 610, 698, 786, 894, 990, 1104, 1218, 1360, 1494, 1658, 1822, 2006, 2174, 2366, 2558, 2786, 2996, 3230, 3464
Offset: 1

Views

Author

Gabriele Fici, Aug 23 2017

Keywords

Comments

A word is closed if it has length 1 or contains a proper factor that occurs only as a prefix and as a suffix in it.
A finite Sturmian word w satisfies the following:
for any factors u, v of the same length, one has abs(|u|_a - |v|_a|) <= 1

Examples

			For n = 4, the closed Sturmian words of length n are "aaaa", "abab", "abba", "baab", "baba" and "bbbb".
		

Crossrefs

Programs

  • Python
    # see link for faster, bit-based version
    from itertools import product
    def is_strm(w): # w is a finite Sturmian word
        for l in range(2, len(w)):
            facts = set(w[j:j+l] for j in range(len(w)-l+1))
            counts = set(f.count('0') for f in facts)
            if max(counts) - min(counts) > 1:
                return False
        return True
    def is_clsd(w): # w is a closed word
        if len(set(w)) <= 1: return True
        for l in range(1, len(w)):
            if w[:l] == w[-l:] and w[:l] not in w[1:-1]:
                return True
        return False
    def is_cs(w):   # w is a closed Sturmian word
        return is_clsd(w) and is_strm(w)
    def a(n):
        return 2*sum(is_cs("0"+"".join(b)) for b in product("01", repeat=n-1))
    print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Sep 27 2021

Formula

a(n) <= min{A226452(n), A005598(n)}. - Michael S. Branicky, Sep 27 2021

Extensions

a(17)-a(40) from Michael S. Branicky, Sep 27 2021

A297526 Number of binary words w of length n such that the number of distinct blocks of length k that w contains is <= k+2 for all k.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 208, 338, 482, 684, 918, 1218, 1526, 1958, 2392, 2918, 3490, 4182, 4888, 5752, 6598, 7626, 8700, 9906, 11110, 12592, 14066, 15700, 17386, 19286, 21188, 23390, 25522, 27994, 30492, 33186, 35900, 39024, 42110, 45428, 48802, 52530, 56240, 60368, 64366, 68842, 73390, 78188, 82966
Offset: 0

Views

Author

Jeffrey Shallit, Dec 31 2017

Keywords

Crossrefs

Cf. A260881, which is the same sequence with "k+2" replaced by "k+1".
Showing 1-3 of 3 results.