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.

User: Gabriele Fici

Gabriele Fici's wiki page.

Gabriele Fici has authored 3 sequences.

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

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

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

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

A188378 Partial sums of A005248.

Original entry on oeis.org

2, 5, 12, 30, 77, 200, 522, 1365, 3572, 9350, 24477, 64080, 167762, 439205, 1149852, 3010350, 7881197, 20633240, 54018522, 141422325, 370248452, 969323030, 2537720637, 6643838880, 17393796002, 45537549125, 119218851372, 312119004990, 817138163597, 2139295485800
Offset: 0

Author

Gabriele Fici, Mar 29 2011

Keywords

Comments

Different from A024851.
Luo proves that these integers cannot be uniquely decomposed as the sum of distinct and nonconsecutive terms of the Lucas number sequence. - Michel Marcus, Apr 20 2020

Crossrefs

Programs

  • Magma
    [5*Fibonacci(n)*Fibonacci(n+1)+1+(-1)^n: n in [0..40]]; // Vincenzo Librandi, Jan 24 2016
  • Maple
    f:= gfun:-rectoproc({a(n+3)-4*a(n+2)+4*a(n+1)-a(n), a(0) = 2, a(1) = 5, a(2) = 12}, a(n), remember):
    map(f, [$0..60]); # Robert Israel, Feb 02 2016
  • Mathematica
    LinearRecurrence[{4,-4,1},{2,5,12},30] (* Harvey P. Dale, Oct 05 2015 *)
    Accumulate@ LucasL@ Range[0, 58, 2] (* Michael De Vlieger, Jan 24 2016 *)
  • PARI
    a(n) = 5*fibonacci(n)*fibonacci(n+1) + 1 + (-1)^n; \\ Michel Marcus, Aug 26 2013
    
  • PARI
    Vec((-2+3*x)/((x-1)*(x^2-3*x+1)) + O(x^100)) \\ Altug Alkan, Jan 24 2016
    

Formula

a(n) = A000032(2n+1)+1 = A002878(n)+1 = 2*A027941(n+1)-3*A027941(n).
G.f.: ( -2+3*x ) / ( (x-1)*(x^2-3*x+1) ). - R. J. Mathar, Mar 30 2011
a(n) = 5*A001654(n) + 1 + (-1)^n, n>=0. [Wolfdieter Lang, Jul 23 2012]
(a(n)^3 + (a(n)-2)^3) / 2 = A000032(A016945(n)) = Lucas(6*n+3) = A267797(n), for n>0. - Altug Alkan, Jan 31 2016
a(n) = 2^(-1-n)*(2^(1+n)-(3-sqrt(5))^n*(-1+sqrt(5))+(1+sqrt(5))*(3+sqrt(5))^n). - Colin Barker, Nov 02 2016