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!)
A248960 Number of ternary words of length n in which all digits 0..2 occur in every 5 consecutive digits. 2
1, 3, 9, 27, 81, 150, 366, 870, 2022, 4686, 10974, 25614, 59742, 139398, 325350, 759198, 1771590, 4134126, 9647262, 22512342, 52533750, 122590422, 286071414, 667563054, 1557794622, 3635198310, 8482932318, 19795382454, 46193598486, 107795266974, 251546100558, 586996465758, 1369788083022 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
G.f.: (1+2*x+4*x^2+10*x^3+28*x^4-8*x^5-14*x^6-6*x^8+3*x^10) / ((1+x)*(1-2*x-2*x^3+x^5)). - Colin Barker, Oct 27 2016
a(n) = a(n-1) + 2*a(n-2) + 2*a(n-3) + 2*a(n-4) - a(n-5) - a(n-6).
a(n) = A242317(n-4) * 6.
MATHEMATICA
Join[{1, 3, 9, 27, 81}, LinearRecurrence[{1, 2, 2, 2, -1, -1}, {150, 366, 870, 2022, 4686, 10974}, 30]] (* Harvey P. Dale, Apr 04 2015 *)
PROG
(PARI) Vec((1+2*x+4*x^2+10*x^3+28*x^4-8*x^5-14*x^6-6*x^8+3*x^10)/((1+x)*(1-2*x-2*x^3+x^5)) + O(x^30)) \\ Colin Barker, Oct 27 2016
CROSSREFS
Sequence in context: A014950 A271351 A036143 * A006521 A289257 A014953
KEYWORD
nonn,easy
AUTHOR
Andrew Woods, Jan 12 2015
EXTENSIONS
Changed offset to 0. - N. J. A. Sloane, Jan 15 2015
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 April 25 05:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)