OFFSET
1,2
COMMENTS
Quasipolynomial of order 2. - Charles R Greathouse IV, Mar 26 2013
LINKS
Torsten Sillke, Crossing the bridge.
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
For n>1: a(n)=n^2/4+3n-5+((-1)^n-1)/8.
G.f.: x*(1+2*x^2+x^3-3*x^4)/((1-x)^3*(1+x)). [Colin Barker, Jun 07 2012]
Contribution from Denis Borris, Mar 26 2013: (Start)
n is even: a(n) = (n^2 + 12n - 20) / 4.
n is odd : a(n) = (n^2 + 12n - 21) / 4.
(End)
EXAMPLE
a(5)=16 since one of the fastest ways is for 1&2 to cross (time 2), 1 to return (1), 4&5 to cross (5), 2 to return (2), 1&3 to cross (3), 1 to return (1) and 1&2 to cross (2) for a total time of 2+1+5+2+3+1+2=16.
PROG
(PARI) a(n)=n^2\4+3*n-5 \\ Charles R Greathouse IV, Mar 26 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jan 03 2003
STATUS
approved