cp's OEIS Frontend

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.

A035005 Number of possible queen moves on an n X n chessboard.

This page as a plain text file.
%I A035005 #70 Sep 02 2025 09:12:40
%S A035005 0,12,56,152,320,580,952,1456,2112,2940,3960,5192,6656,8372,10360,
%T A035005 12640,15232,18156,21432,25080,29120,33572,38456,43792,49600,55900,
%U A035005 62712,70056,77952,86420,95480,105152,115456,126412,138040,150360
%N A035005 Number of possible queen moves on an n X n chessboard.
%C A035005 The number of (2 to n) digit sequences that can be found reading in any orientation, including diagonals, in an (n X n) grid. - _Paul Cleary_, Aug 12 2005
%H A035005 Vincenzo Librandi, <a href="/A035005/b035005.txt">Table of n, a(n) for n = 1..1000</a>
%H A035005 Milan Janjic and Boris Petkovic, <a href="http://arxiv.org/abs/1301.4550">A Counting Function</a>, arXiv preprint arXiv:1301.4550 [math.CO], 2013. - From _N. J. A. Sloane_, Feb 13 2013
%H A035005 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F A035005 a(n) = (n-1)*2*n^2 + (4*n^3-6*n^2+2*n)/3.
%F A035005 From _Johannes W. Meijer_, Feb 04 2010: (Start)
%F A035005 a(n) = A002492(n-1) + A035006(n) since Queen = Bishop + Rook.
%F A035005 a(n) = 4 * A162147(n-1). (End)
%F A035005 a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4); a(0)=0, a(1)=12, a(2)=56, a(3)=152. - _Harvey P. Dale_, Aug 24 2011
%F A035005 From _Colin Barker_, Mar 11 2012: (Start)
%F A035005 a(n) = 2*n*(1-6*n+5*n^2)/3.
%F A035005 G.f.: 4*x^2*(3+2*x)/(1-x)^4. (End)
%F A035005 E.g.f.: 2*exp(x)*x^2*(9 + 5*x)/3. - _Stefano Spezia_, Jul 31 2022
%e A035005 3 X 3 board: queen has 8*6 moves and 1*8 moves, so a(3)=56.
%t A035005 Table[(n-1)2n^2+(4n^3-6n^2+2n)/3,{n,40}] (* or *) LinearRecurrence[ {4,-6,4,-1},{0,12,56,152},40] (* _Harvey P. Dale_, Aug 24 2011 *)
%o A035005 (Magma) [(n-1)*2*n^2 + (4*n^3-6*n^2+2*n)/3: n in [1..40]]; // _Vincenzo Librandi_, Jun 16 2011
%Y A035005 Cf. A033586 (King), A035006 (Rook), A035008 (Knight), A002492 (Bishop) and A049450 (Pawn).
%Y A035005 Cf. A162147.
%K A035005 nonn,easy,nice,changed
%O A035005 1,2
%A A035005 Ulrich Schimke (ulrschimke(AT)aol.com)
%E A035005 More terms from _Erich Friedman_