OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Robert M. Ziff, On Cardy's formula for the critical crossing probability in 2d percolation, J. Phys. A. 28, 1249-1255 (1995).
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(2n-1) = (2n-1)^2; a(2n)=4n^2+n. - Emeric Deutsch, Aug 03 2005
G.f.: x*(1+4*x+2*x^2+x^3)/((1+x)^2*(1-x)^3). - Bruno Berselli, Mar 19 2012
a(n) = n(4n+(-1)^n+1)/4. - Bruno Berselli, Mar 19 2012
EXAMPLE
a(4) = 4+5+3+6 = 18.
a(5) = 5+6+4+7+3 = 25.
MAPLE
a:=proc(n) if n mod 2 = 0 then n^2+n/2 else n^2 fi end: seq(a(n), n=1..60); # Emeric Deutsch, Aug 03 2005
MATHEMATICA
f[n_]:=If[OddQ[n], n^2, n/2*(2n+1)]; Array[f, 50] (* Harvey P. Dale, Mar 17 2012 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Jul 21 2005
EXTENSIONS
More terms from Emeric Deutsch, Aug 03 2005
STATUS
approved