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!)
A287804 Number of quinary sequences of length n such that no two consecutive terms have distance 1. 31
1, 5, 17, 59, 205, 713, 2481, 8635, 30057, 104629, 364225, 1267923, 4413861, 15365465, 53490097, 186209299, 648230545, 2256616133, 7855718641, 27347281995, 95201200637, 331413874569, 1153716087665, 4016309864843, 13981555011321, 48672509644725 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
a(n) = 5*a(n-1) - 5a(n-2) - a(n-3), a(0)=1, a(1)=5, a(2)=17.
G.f.: (1 - 3*x^2)/(1 - 5*x + 5*x^2 + x^3).
EXAMPLE
For n=2 the a(2)=17=25-8 sequences contain every combination except these eight: 01,10,12,21,23,32,34,43.
MATHEMATICA
LinearRecurrence[{5, -5, -1}, {1, 5, 17}, 50]
PROG
(Python)
def a(n):
if n in [0, 1, 2]:
return [1, 5, 17][n]
return 5*a(n-1)-5*a(n-2)-a(n-3)
CROSSREFS
Sequence in context: A171838 A105392 A090857 * A149657 A149658 A149659
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 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)