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-1 of 1 results.

A283834 Number of length-n binary vectors beginning with 0, ending with 1, and avoiding 4 consecutive 0's and 4 consecutive 1's.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, Mar 25 2017

Keywords

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 1/((1+x)*(1+x^2)*(1-x-x^2-x^3)) )); // 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 *)
  • PARI
    Vec(1/((1+x)*(1+x^2)*(1-x-x^2-x^3)) + O(x^50)) \\ Indranil Ghosh, Mar 26 2017
    
  • SageMath
    @CachedFunction
    def b(n): # b = A000073
        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))
    [A283834(n) for n in range(41)] # G. C. Greubel, Feb 09 2023

Formula

G.f.: 1/((1+x)*(1+x^2)*(1-x-x^2-x^3)). - Alois P. Heinz, Mar 25 2017
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

Extensions

More terms from Alois P. Heinz, Mar 25 2017
Showing 1-1 of 1 results.