%I #47 Aug 25 2022 04:36:20
%S 1,3,9,15,25,35,49,63,81,99,121,143,169,195,225,255,289,323,361,399,
%T 441,483,529,575,625,675,729,783,841,899,961,1023,1089,1155,1225,1295,
%U 1369,1443,1521,1599,1681,1763,1849,1935,2025,2115,2209,2303,2401,2499,2601
%N a(n) = n^2 - (1 + (-1)^n)/2.
%C Sequence pattern looks like this 1*1, 1*3, 3*3, 3*5, 5*5, 5*7, 7*7, 7*9, 9*9, 9*11, 11*11, ... = A109613(n-1)*A109613(n).
%C a(n+1) is the determinant of the n X n matrix M_(i, i)=3, M_(i, j)=2 if (i+j) is even, M_(i, j)=0 if (i+j) is odd. - _Benoit Cloitre_, Aug 06 2003
%C a(n) is also the longest path, in number of cells, between diagonally opposite corners of an n X n matrix if diagonal movement between adjacent cells is not allowed and no cell is used more than once. - _Ray G. Opao_, Jul 02 2007
%C (-1)^n*a(n) appears to be the Hankel transform of A141222. - _Paul Barry_, Jun 14 2008
%C Take an n X n square grid and add unit squares along each side except for the corners --> do this repeatedly along each side with the same restriction until no squares can be added. 4*a(n) is the total number of unit edges in each figure (see example and cf. A255840, A255876). - _Wesley Ivan Hurt_, Mar 09 2015
%H Stefano Spezia, <a href="/A085046/b085046.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F a(1) = 1, a(2) = 3, then a(2n) = (a(2n-1)*a(2n+1))^1/2 and a(2n+1) = {a(2n) + a(2n+2)}/2. Even-indexed terms are the geometric mean, and odd-indexed terms are the arithmetic mean, of their neighbors.
%F a(2n+1) = (2n+1)^2 and a(2n) = 4n^2 - 1.
%F a(n) = A008811(2n) - 1. - _N. J. A. Sloane_, Jun 12 2004
%F From _Bruno Berselli_, Sep 17 2013: (Start)
%F G.f.: x*(1 + x + 3*x^2 - x^3)/((1+x)*(1-x)^3).
%F a(n) = n^2 - (1 + (-1)^n)/2. (End)
%F a(1)=1, a(2)=3, a(3)=9, a(4)=15, a(n) = 2*a(n-1) + 0*a(n-2) - 2*a(n-3) + a(n-4). - _Harvey P. Dale_, Oct 25 2015
%F E.g.f.: 1 - cosh(x) + x*(1 + x)*(cosh(x) + sinh(x)). - _Stefano Spezia_, May 26 2021
%F Sum_{n>=1} 1/a(n) = Pi^2/8 + 1/2. - _Amiram Eldar_, Aug 25 2022
%e 4*a(n) is the number of unit edges in the pattern below (see comments).
%e _
%e _|_|_
%e _ _ _ _|_|_|_|_
%e _|_|_ _|_|_|_ _|_|_|_|_|_|_
%e _ _ _|_|_|_|_ _|_|_|_|_|_ _|_|_|_|_|_|_|_|_
%e _ |_|_| |_|_|_|_|_| |_|_|_|_|_|_| |_|_|_|_|_|_|_|_|_|
%e |_| |_|_| |_|_|_| |_|_|_|_|_|_| |_|_|_|_|_|_|_|
%e |_| |_|_|_|_| |_|_|_|_|_|
%e |_|_| |_|_|_|
%e |_|
%e n=1 n=2 n=3 n=4 n=5
%e - _Wesley Ivan Hurt_, Mar 09 2015
%p A085046:=n->n^2-(1+(-1)^n)/2: seq(A085046(n), n=1..100); # _Wesley Ivan Hurt_, Mar 09 2015
%t Table[n^2-1/2 (1+(-1)^n), {n, 60}] (* _Bruno Berselli_, Sep 17 2013 *)
%t LinearRecurrence[{2,0,-2,1},{1,3,9,15},70] (* _Harvey P. Dale_, Oct 25 2015 *)
%o (Magma) [n^2-(1+(-1)^n)/2 : n in [1..100]]; // _Wesley Ivan Hurt_, Mar 09 2015
%Y Cf. A109613. [_Bruno Berselli_, Sep 17 2013]
%Y Cf. A008811, A141222, A255840, A255876.
%K nonn,easy
%O 1,2
%A _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 20 2003
%E More terms from _Benoit Cloitre_, Aug 06 2003
%E Formula added in the first comment by _Bruno Berselli_, Sep 17 2013
%E Replaced name with Sep 17 2013 formula from _Bruno Berselli_ [_Wesley Ivan Hurt_, May 17 2020]