OFFSET
0,2
COMMENTS
Comment from N. J. A. Sloane, May 28 2026 (Start):
Consider the square spiral with cells numbered starting at 0, as in A392177 and A392178. The sequence lists the cells that can be reached in a single move by a queen placed at cell 0. A396179 lists the cells that the queen cannot reach in a single move, and begins with the eight cells that could be reached by a knight placed at cell 0.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 191
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,1,-2,1).
FORMULA
G.f.: 1/((1-x)^2*(1-x^8)).
From Mitch Harris, Sep 08 2008: (Start)
a(n) = Sum_{j=0..n+8} floor(j/8).
a(n-8) = (1/2)*floor(n/8)*(2*n-6-8*floor(n/8)). (End)
a(n) = 2*a(n-1) - a(n-2) + a(n-8) - 2*a(n-9) + a(n-10). - R. J. Mathar, Apr 20 2010
MAPLE
seq(coeff(series(1/(1-x)^2/(1-x^8), x, n+1), x, n), n=0..80);
MATHEMATICA
CoefficientList[Series[1/((1-x)^2*(1-x^8)), {x, 0, 80}], x] (* Vincenzo Librandi, Jun 11 2013 *)
(* Alternative: *)
LinearRecurrence[{2, -1, 0, 0, 0, 0, 0, 1, -2, 1}, {1, 2, 3, 4, 5, 6, 7, 8, 10, 12}, 80] (* Harvey P. Dale, Jan 07 2015 *)
PROG
(PARI) my(x='x+O('x^80)); Vec(1/((1-x)^2*(1-x^8))) \\ G. C. Greubel, Sep 09 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 80); Coefficients(R!( 1/((1-x)^2*(1-x^8)) )); // G. C. Greubel, Sep 09 2019
(SageMath)
def A008726_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(1/((1-x)^2*(1-x^8))).list()
A008726_list(80) # G. C. Greubel, Sep 09 2019
(GAP) a:=[1, 2, 3, 4, 5, 6, 7, 8, 10, 12];; for n in [11..80] do a[n]:=2*a[n-1] -a[n-2]+a[n-8]-2*a[n-9]+a[n-10]; od; a; # G. C. Greubel, Sep 09 2019
(Python)
def A008726(n): return ((n>>3)+1)*(n+1-(n>>1&-4)) # Chai Wah Wu, May 28 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Vladimir Joseph Stephan Orlovsky, Mar 14 2010
Minor edits by Jon E. Schoenfield, Mar 28 2014
STATUS
approved
