|
|
A283834
|
|
Number of length-n binary vectors beginning with 0, ending with 1, and avoiding 4 consecutive 0's and 4 consecutive 1's.
|
|
3
|
|
|
1, 0, 1, 2, 4, 6, 12, 22, 41, 74, 137, 252, 464, 852, 1568, 2884, 5305, 9756, 17945, 33006, 60708, 111658, 205372, 377738, 694769, 1277878, 2350385, 4323032, 7951296, 14624712, 26899040, 49475048, 90998801, 167372888, 307846737, 566218426, 1041438052
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (1/4)*((-1)^n + i^n*(n+1 mod 2) - i^(n+3)*(n mod 2) + 2*A000073(n+2)). - G. C. Greubel, Feb 09 2023
|
|
MATHEMATICA
|
CoefficientList[Series[1/((1+x)*(1+x^2)*(1-x-x^2-x^3)), {x, 0, 50}], x] (* Indranil Ghosh, Mar 26 2017 *)
|
|
PROG
|
(PARI) Vec(1/((1+x)*(1+x^2)*(1-x-x^2-x^3)) + O(x^50)) \\ Indranil Ghosh, Mar 26 2017
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 1/((1+x)*(1+x^2)*(1-x-x^2-x^3)) )); // G. C. Greubel, Feb 09 2023
(SageMath)
@CachedFunction
if (n<3): return (0, 0, 1)[n]
else: return b(n-1) + b(n-2) + b(n-3)
def A283834(n): return (1/4)*((-1)^n +i^n*((n+1)%2) -i^(n+3)*(n%2) +2*b(n+2))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|