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.

A003000 Number of bifix-free (or primary, or unbordered) words of length n over a two-letter alphabet.

Original entry on oeis.org

1, 2, 2, 4, 6, 12, 20, 40, 74, 148, 284, 568, 1116, 2232, 4424, 8848, 17622, 35244, 70340, 140680, 281076, 562152, 1123736, 2247472, 4493828, 8987656, 17973080, 35946160, 71887896, 143775792, 287542736, 575085472, 1150153322, 2300306644, 4600578044, 9201156088
Offset: 0

Views

Author

Keywords

Comments

This is the number of binary words w of length n such that there is no nonempty word x, different from w, which is both a prefix and a suffix of w. - N. J. A. Sloane, Nov 09 2012
Many authors use the term "unbordered" for "bifix-free". The Lothaire (1997) reference refers to bifix-free words as primary words (Chapter 8). - David Callan, Sep 25 2006
Also the number of binary "prime palstars" of length 2n (Rampersad, Shallit, & Wang 2011). - Jeffrey Shallit, Aug 14 2014

Examples

			Bi-fix free words of lengths 1 through 4:
0, 1
10, 01
100, 110, 011, 001
1000, 1100, 1110, 0111, 0011, 0001.
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 28.
  • M. Lothaire, Combinatorics on Words, Cambridge University Press, NY, 1997, see p. 153.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals 2 * A045690 for n > 0. Complement gives A094536.

Programs

  • Maple
    A[0]:= 1:
    for n from 1 to 100 do
    if n::odd then A[n]:= 2*A[n-1] else A[n]:= 2*A[n-1]-A[n/2] fi
    od:
    seq(A[n],n=0..100); # Robert Israel, Aug 14 2014
  • Mathematica
    a[0]=1;a[n_]:=a[n]=2*a[n-1]-(1+(-1)^n)/2*a[Floor[n/2]]; Table[a[n], {n, 0, 34}]
    a[0]=1; a[n_]:=a[n]=2*a[n-1]-If[EvenQ[n], a[n/2], 0] (* Ed Pegg Jr, Jan 05 2005 *)

Formula

a(2*n+1) = 2*a(2*n), a(2*n) = 2*a(2*n-1) - a(n).
a(n)/2^n converges to A242430.
a(0)=1; a(n)=2*a(n-1)-(1/2)*(1+(-1)^n)*a([n/2]). - Farideh Firoozbakht, Jun 10 2004
G.f.: g(x) satisfies (1-2*x)*g(x) = 2 - g(x^2). - Robert Israel, Jan 12 2015

Extensions

New description and reference from Jeffrey Shallit, Sep 15 1996
Additional comments from Torsten.Sillke(AT)lhsystems.com, Jan 17 2001
More terms from Farideh Firoozbakht, Jun 10 2004

A262312 The limit, as word-length approaches infinity, of the probability that a random binary word is an instance of the Zimin pattern "aba"; also the probability that a random infinite binary word begins with an even-length palindrome.

Original entry on oeis.org

7, 3, 2, 2, 1, 3, 1, 5, 9, 7, 8, 2, 1, 1, 0, 8, 8, 7, 6, 2, 3, 3, 2, 8, 5, 9, 6, 4, 1, 5, 6, 9, 7, 4, 4, 7, 4, 4, 4, 9, 4, 0, 1, 0, 2, 0, 0, 6, 5, 1, 5, 4, 6, 7, 9, 2, 3, 6, 8, 8, 1, 1, 1, 4, 8, 8, 7, 8, 5, 0, 6, 2, 2, 1, 4, 7, 6, 7, 2, 3, 7
Offset: 0

Views

Author

Danny Rorabaugh, Sep 17 2015

Keywords

Comments

Word W over alphabet L is an instance of "aba" provided there exists a nonerasing monoid homomorphism f:{a,b}*->L* such that f(W)=aba. For example "oompaloompa" is an instance of "aba" via the homomorphism defined by f(a)=oompa, f(b)=l. For a proof of the formula or more information on Zimin words, see Rorabaugh (2015).
The second definition comes from a Comment in A094536: "The probability that a random, infinite binary string begins with an even-length palindrome is: lim n -> infinity a(n)/2^n ~ 0.7322131597821108... . - Peter Kagey, Jan 26 2015"
Also, the limit, as word-length approaches infinity, of the probability that a random binary word has a bifix; that is, 1-x where x is the constant from A242430. - Danny Rorabaugh, Feb 13 2016

Examples

			0.7322131597821108876233285964156974474449401020065154679236881114887...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 5.17, p. 369.

Crossrefs

Programs

  • Sage
    N(sum([2*(1/4)^(2^j)*(-1)^j/prod([1-2*(1/4)^(2^k) for k in range(j+1)]) for j in range(8)]),digits=81) #For more than 152 digits of accuracy, increase the j-range.

Formula

The constant is Sum_{n>=0} A003000(n)*(1/4)^n.
Using the recursive definition of A003000, one can derive the series Sum_{j>=0} 2*(-1)^j*(1/4)^(2^j)/(Product_{k=0..j} 1-2*(1/4)^(2^k)), which converges more quickly to the same limit and without having to calculate terms of A003000.
For ternary words, the constant is Sum_{n>=0} A019308(n)*(1/9)^n.
For quaternary words, the constant is Sum_{n>=0} A019309(n)*(1/16)^n.

A330651 a(n) = n^4 + 3*n^3 + 2*n^2 - 2*n.

Original entry on oeis.org

0, 4, 44, 174, 472, 1040, 2004, 3514, 5744, 8892, 13180, 18854, 26184, 35464, 47012, 61170, 78304, 98804, 123084, 151582, 184760, 223104, 267124, 317354, 374352, 438700, 511004, 591894, 682024, 782072, 892740, 1014754, 1148864, 1295844
Offset: 0

Views

Author

Ed Pegg Jr, Jan 15 2020

Keywords

Comments

a(n)/A269657(n) gives unforgeable word approximations (A003000) with increasing accuracy, as follows: 4/15, 44/79, 174/253, ... ~ 0.26 (A242430), 0.5569 (A019308), 0.68774 (A019309), 0.8055770, 0.83674321, 0.85937882, 0.87654509, 0.89000100, 0.9008270111, ....

Crossrefs

Programs

  • Maple
    A330651 := n -> (((n+3)*n+2)*n-2)*n; # M. F. Hasler, Feb 29 2020
  • Mathematica
    Numerator/@Table[(-2 n+2 n^2+3 n^3+n^4)/(1+3 n+6 n^2+4 n^3+n^4),{n,0,33}] (* Ed Pegg Jr, Jan 15 2020 *)
  • PARI
    Vec(2*x*(2 + 12*x - 3*x^2 + x^3) / (1 - x)^5 + O(x^40),-40) \\ Colin Barker, Jan 15 2020
    
  • PARI
    apply( {A330651(n)=(((n+3)*n+2)*n-2)*n}, [0..44]) \\ M. F. Hasler, Feb 29 2020

Formula

From Colin Barker, Jan 15 2020: (Start)
G.f.: 2*x*(2 + 12*x - 3*x^2 + x^3) / (1 - x)^5.
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5) for n>5.
(End)
E.g.f.: exp(x)*x*(4 + 18*x + 9*x^2 + x^3). - Stefano Spezia, Feb 03 2020
Showing 1-3 of 3 results.