|
Search: id:A102026
|
|
|
| A102026 |
|
Number of n-bit strings that contain no more than 4 zeros and no more than 2 leading and 2 trailing zeros. |
|
+0 1
|
|
| 2, 4, 7, 13, 25, 49, 97, 191, 375, 737, 1449, 2849, 5601, 11011, 21647, 42557, 83665, 164481, 323361, 635711, 1249775, 2456993, 4830321, 9496161, 18668961, 36702211, 72154647, 141852301, 278874281, 548252401, 1077835841, 2118969471
(list; graph; listen)
|
|
|
OFFSET
|
1,1
|
|
|
COMMENT
|
Used in the NRZ encoding to avoid substrings of more than 4 zeros.
|
|
REFERENCES
|
Raphael Reischuk, On avoiding monochrome substrings of length 5.
|
|
LINKS
|
Raphael Reischuk, On avoiding monochrome substrings of length 5.
|
|
EXAMPLE
|
a(3) = 2^3 - 1 = 7, since '000' is not a valid string, but all others are.
|
|
MATHEMATICA
|
m[x_] := If[x <= 4, 2^x,
If[x == 5, 31,
m[x - 1] + m[x - 2] + m[x - 3] + m[x - 4] + m[x - 5]]]
c[x_] := If[x <= 2, 0,
If[x == 3, 1,
If[x == 4, 3,
If[x == 5, 6,
If[x == 6, 12,
If[x == 7, 23,
If[x == 8, 45, 2*c[x - 1] - c[x - 6]]]]]]]]
valid[x_] := m[x] - c[x]
|
|
CROSSREFS
|
Sequence in context: A108361 A082423 A119266 this_sequence A103204 A017995 A099155
Adjacent sequences: A102023 A102024 A102025 this_sequence A102027 A102028 A102029
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Raphael Reischuk (raphael(AT)stud.uni-saarland.de), Jun 18 2007
|
|
EXTENSIONS
|
There are non-ASCII characters that need to be changed! - njas, Feb 09 2008
|
|
|
Search completed in 0.002 seconds
|