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!)
A287805 Number of quinary sequences of length n such that no two consecutive terms have distance 2. 0
1, 5, 19, 73, 281, 1083, 4175, 16097, 62065, 239307, 922711, 3557761, 13717913, 52893147, 203943935, 786361409, 3032030689, 11690820555, 45077144455, 173807214241, 670161078089, 2583988659867, 9963272432111, 38416111919777, 148123788152017, 571131629935179 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
For n>0, a(n) = 4*a(n-1) + a(n-2) - 6*a(n-3), a(1)=5, a(2)=19, a(3)=73.
G.f.: (1 + x - 2*x^2 - 2*x^3)/(1 - 4*x - x^2 + 6*x^3).
EXAMPLE
For n=2 the a(2)=19=25-6 sequences contain every combination except these six: 02,20,13,31,24,42.
MATHEMATICA
LinearRecurrence[{4, 1, -6}, {1, 5, 19, 73}, 40]
PROG
(Python)
def a(n):
.if n in [0, 1, 2, 3]:
..return [1, 5, 19, 73][n]
.return 4*a(n-1)+a(n-2)-6*a(n-3)
CROSSREFS
Sequence in context: A034548 A255455 A255444 * A129166 A149763 A149764
KEYWORD
nonn,easy
AUTHOR
David Nacin, Jun 01 2017
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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)