The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A143454 Expansion of 1/(x^k*(1 - x - 3*x^(k+1))) for k=3. 5
1, 4, 7, 10, 13, 25, 46, 76, 115, 190, 328, 556, 901, 1471, 2455, 4123, 6826, 11239, 18604, 30973, 51451, 85168, 140980, 233899, 388252, 643756, 1066696, 1768393, 2933149, 4864417, 8064505, 13369684, 22169131, 36762382, 60955897, 101064949, 167572342 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
a(n) is also the number of length n quaternary words with at least 3 0-digits between any other digits.
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n >= 7, 4*a(n-7) equals the number of 4-colored compositions of n with all parts >= 4, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
LINKS
D. Birmajer, J. B. Gil, and M. D. Weiner, On the Enumeration of Restricted Words over a Finite Alphabet, J. Int. Seq. 19 (2016) # 16.1.3, Example 9.
FORMULA
G.f.: (1 + 3*x + 3*x^2 + 3*x^3) / (1 - x - 3*x^4). - R. J. Mathar, Aug 04 2019
a(n) = Sum_{j=0..(n+3)/3} 3^j*C(n-3*j+3,j). - Vladimir Kruchinin, May 24 2011
MAPLE
a:= proc(k::nonnegint) local n, i, j; if k=0 then unapply(4^n, n) else unapply((Matrix(k+1, (i, j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 3 else 0 fi)^(n+k))[1, 1], n) fi end(3): seq(a(n), n=0..50);
MATHEMATICA
a[n_]:= Sum[3^j*Binomial[n-3*j+3, j], {j, 0, (n+3)/3}]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 04 2014, after Vladimir Kruchinin *)
LinearRecurrence[{1, 0, 0, 3}, {1, 4, 7, 10}, 41] (* G. C. Greubel, May 08 2021 *)
PROG
(Maxima) a(n):= sum(3^j*binomial(n-3*j+3, j), j, 0, (n+3)/3); /* Vladimir Kruchinin, May 24 2011 */
(PARI) Vec(1/(x^3*(1-x-3*x^4))+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
(PARI) my(p=Mod('x, 'x^4-'x^3-3)); a(n) = vecsum(Vec(lift(p^(n+3)))); \\ Kevin Ryde, May 11 2021
(Magma) [n le 4 select 3*n-2 else Self(n-1) +3*Self(n-4): n in [1..51]]; // G. C. Greubel, May 08 2021
(Sage)
def a(n): return 3*n+1 if (n<4) else a(n-1) + 3*a(n-4)
[a(n) for n in (0..40)] # G. C. Greubel, May 08 2021
CROSSREFS
3rd column of A143461.
Sequence in context: A069212 A091290 A119256 * A318774 A341282 A065810
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Aug 16 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 3 20:36 EDT 2024. Contains 373088 sequences. (Running on oeis4.)