login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A120413
Largest even number strictly less than n^2.
1
0, 2, 8, 14, 24, 34, 48, 62, 80, 98, 120, 142, 168, 194, 224, 254, 288, 322, 360, 398, 440, 482, 528, 574, 624, 674, 728, 782, 840, 898, 960, 1022, 1088, 1154, 1224, 1294, 1368, 1442, 1520, 1598, 1680, 1762, 1848, 1934, 2024, 2114, 2208, 2302, 2400, 2498, 2600
OFFSET
1,2
COMMENTS
Longest non-intersecting route from (0, 0) to (n - 1, n - 1) staying in an (n - 1) X (n - 1) box (shortest route is length 2n A005843).
FORMULA
a(n) = 2*ceiling[n^2/2] - 2 = 2*A074148(n) = A085046(n) - 1.
From Colin Barker, Jul 29 2012: (Start)
a(n) = (-1 + (-1)^n + 4*n + 2*n^2)/2.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: 2*x*(1 + 2*x - x^2)/((1-x)^3*(1+x)). (End)
a(n) = n^2 - 2 for even n; a(n) = n^2 - 1 for odd n. -Dennis P. Walsh, Apr 15 2016
MAPLE
seq(2*ceil(n^2/2)-2, n=1..50);
MATHEMATICA
Flatten[Table[{(2n - 1)^2 - 1, 4n^2 - 2}, {n, 25}]] (* Alonso del Arte, Apr 15 2016 *)
PROG
(PARI) lista(nn) = for(n=0, nn, print1((-1+(-1)^n+4*n+2*n^2)/2, ", ")); \\ Altug Alkan, Apr 15 2016
CROSSREFS
Sequence in context: A344161 A375472 A107072 * A161156 A125902 A295055
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Jul 06 2006
EXTENSIONS
Offset corrected by N. J. A. Sloane, Apr 15 2016
STATUS
approved