This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A152132 #20 Apr 20 2023 04:23:37 %S A152132 2,8,24,54,104,174,270,396,558,756,996,1282,1620,2010,2458,2968,3546, %T A152132 4192,4912,5710,6592,7558,8614,9764,11014,12364,13820,15386,17068, %U A152132 18866,20786,22832,25010,27320,29768,32358,35096,37982,41022,44220,47582 %N A152132 Maximal length of rook tour on an n X n+1 board. %D A152132 M. Gardner, Knotted Doughnuts and Other Mathematical Entertainments. Freeman, NY, 1986, p. 76. %H A152132 Vincenzo Librandi, <a href="/A152132/b152132.txt">Table of n, a(n) for n = 1..1000</a> %H A152132 <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1,1,-3,3,-1). %F A152132 G.f.: -2*x*(-1-x-2*x^3-2*x^4-3*x^2+x^5)/(1+x)/(x^2+1)/(x-1)^4. %F A152132 a(n) = 3*a(n-1) -3*a(n-2) +a(n-3) +a(n-4) -3*a(n-5) +3*a(n-6) -a(n-7). %F A152132 a(n) = 2*n^3/3+n^2-7*n/6+3/4-(-1)^n/4-A087960(n)/2. %p A152132 # Figure 43 of the Gardner book: %p A152132 C := proc(n,m) %p A152132 if type(m,even) and type(n,even) then %p A152132 2 ; %p A152132 elif type(m,odd) and type(n,odd) then %p A152132 1 ; %p A152132 elif type(m,even) and type(n,odd) and type(floor(n/2),even) then %p A152132 3/2 ; %p A152132 elif type(m,even) and type(n,odd) and type(floor(n/2),odd) then %p A152132 1/2 ; %p A152132 elif type(m,odd) and type(n,even) and type(floor(n/2),even) then %p A152132 0 ; %p A152132 elif type(m,odd) and type(n,even) and type(floor(n/2),odd) then %p A152132 1 ; %p A152132 fi; %p A152132 end: %p A152132 # formula for n X m boards, from the Gardner book: %p A152132 T := proc(n,m) %p A152132 n*(3*m^2+n^2-10)/6+C(n,m) ; %p A152132 end: %p A152132 for n from 1 to 24 do %p A152132 m := n+3 ; # third diagonal here, for example %p A152132 printf("%d,",T(n,m)) ; %p A152132 od: %t A152132 CoefficientList[Series[-2 * (-1 - x - 2*x^3 - 2*x^4 - 3*x^2 + x^5)/(1 + x)/(x^2 + 1)/(x - 1)^4, {x, 0, 40}], x] (* _Vincenzo Librandi_, Dec 14 2012 *) %o A152132 (Magma) I:=[2, 8, 24, 54, 104, 174, 270]; [n le 7 select I[n] else 3*Self(n-1) - 3*Self(n-2) + Self(n-3) + Self(n-4) - 3*Self(n-5) + 3*Self(n-6)- Self(n-7): n in [1..50]]; // _Vincenzo Librandi_, Dec 14 2012 %Y A152132 Cf. A006071, A087960, A152133, A152134, A152135. %K A152132 nonn,easy %O A152132 1,1 %A A152132 _R. J. Mathar_, Mar 22 2009 %E A152132 More terms from _R. J. Mathar_, Sep 22 2009