A230216 Number of binary strings of length n avoiding "squares" (that is, repeated blocks of the form xx) with |x| = 3.
1, 2, 4, 8, 16, 32, 56, 104, 192, 352, 648, 1192, 2192, 4032, 7416, 13640, 25088, 46144, 84872, 156104, 287120, 528096, 971320, 1786536, 3285952, 6043808, 11116296, 20446056, 37606160, 69168512, 127220728, 233995400, 430384640, 791600768, 1455980808
Offset: 0
Examples
For n = 6 there are 8 strings omitted, namely 000000, 001001, ..., 111111, so a(6) = 64-8 = 56.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,1).
Programs
-
PARI
Vec((1 + x + x^2 + x^3 + 2*x^4 + 4*x^5) / (1 - x - x^2 - x^3) + O(x^40)) \\ Colin Barker, Aug 09 2019
Formula
a(n) = 8*A000073(n) for n >= 3.
From Colin Barker, Aug 09 2019: (Start)
G.f.: (1 + x + x^2 + x^3 + 2*x^4 + 4*x^5) / (1 - x - x^2 - x^3).
a(n) = a(n-1) + a(n-2) + a(n-3) for n>5.
(End)