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.

Showing 1-8 of 8 results.

A008794 Squares repeated; a(n) = floor(n/2)^2.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 9, 9, 16, 16, 25, 25, 36, 36, 49, 49, 64, 64, 81, 81, 100, 100, 121, 121, 144, 144, 169, 169, 196, 196, 225, 225, 256, 256, 289, 289, 324, 324, 361, 361, 400, 400, 441, 441, 484, 484, 529, 529, 576, 576
Offset: 0

Views

Author

Keywords

Comments

Also number of non-attacking kings on (n-1) X (n-1) board (cf. A030978). - Koksal Karakus (karakusk(AT)hotmail.com), May 27 2002
Also the independence number and clique covering number of the (n-1) X (n-1) king graph. - Eric W. Weisstein, Jun 20 2017
Maximum number of 2 X 2 tiles that fit on an n X n board. - Jon Perry, Aug 10 2003
(n)-(1) + (n-1)-(2) + (n-3)-(3) + ... + (n-r)-(r) ... n terms. E.g., 5-1+4-2+3 = 9, 6-1+5-2+4-3 = 9, 7-1+6-2+5-3+4 = 16, 8-1+7-2+6-3+5-4 = 16. - Amarnath Murthy, Jul 24 2005
The smallest possible number of white cells in a solution to an n X n nurikabe grid. - Tanya Khovanova, Feb 24 2009
(1 + x + 4*x^2 + 4*x^3 + 9*x^4 + ...) = (1/(1-x))*(1 + 3*x^2 + 5*x^4 + 7*x^6 + ...). - Gary W. Adamson, Apr 07 2010
If the set {1,2,...,n} is divided in half (a part having size ceiling(n/2) and the rest), then a(n+1) is the largest possible difference between the totals of these parts. - Vladimir Shevelev, Oct 14 2017
a(n+1) is the sum of the smallest parts of the partitions of 2n into two odd parts. - Wesley Ivan Hurt, Dec 06 2017
a(n-1) is the largest number of single cells of an n X n grid that share no edge or vertex with each other or those of the grid perimeter. - Stefano Spezia, Jul 30 2021
The binomial transform is 0, 0, 1, 4, 14, 44, 128, 352, 928, 2368, 5888... (see A007466). - R. J. Mathar, Feb 25 2023

Crossrefs

Programs

  • GAP
    Flat(List([0..24],n->[n^2,n^2])); # Muniru A Asiru, Oct 09 2018
    
  • Magma
    [(2*n-1)*(-1)^n/8+(2*n^2-2*n +1)/8: n in [0..60]]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A008794:=n->floor(n/2)^2: seq(A008794(n), n=0..50); # Wesley Ivan Hurt, Dec 08 2017
  • Mathematica
    With[{sq = Range[0, 30]^2}, Riffle[sq, sq]] (* Harvey P. Dale, Nov 20 2015 *)
    Table[Floor[n/2]^2, {n, 0, 49}] (* Michael De Vlieger, Oct 21 2016 *)
    Table[(2 n - 1) (-1)^n/8 + (2 n^2 - 2 n + 1)/8, {n, 0, 49}] (* Michael De Vlieger, Oct 21 2016 *)
    CoefficientList[Series[x^2*(1 + x^2)/((1 - x) (1 - x^2)^2), {x, 0, 49}], x] (* Michael De Vlieger, Oct 21 2016 *)
    CoefficientList[Series[((x^2-x)Cosh[x]+(1+x+x^2)Sinh[x])/4,{x,0,50}],x]*Table[k!,{k,0,50}] (* Stefano Spezia, Oct 07 2018 *)
  • PARI
    a(n)=(n\2)^2 \\ Charles R Greathouse IV, Sep 24 2015
    
  • PARI
    first(n) = Vec(x^2*(1 + x^2)/((1 - x)*(1 - x^2)^2) + O(x^n), -n) \\ Iain Fox, Dec 08 2017
    
  • Python
    def A008794(n): return (n//2)**2 # Chai Wah Wu, Jun 07 2022
  • Sage
    [((-1)^n*(2*n-1) +(2*n^2-2*n +1))/8 for n in (0..50)] # G. C. Greubel, Sep 11 2019
    

Formula

G.f.: x^2*(1 + x^2)/((1 - x)*(1 - x^2)^2).
a(n) = floor(n/2)^2.
From Paul Barry, May 31 2003: (Start)
a(n) = (2*n - 1)*(-1)^n/8 + (2*n^2 - 2*n + 1)/8.
a(n+1) = Sum_{k=0..n} k*(1-(-1)^k)/2. (End)
a(n+2) = Sum_{k=0..n} A109613(k)*A059841(n-k). - Reinhard Zumkeller, Dec 05 2009
a(n) = A182579(n,n-2) for n > 1. - Reinhard Zumkeller, May 07 2012
3*a(n) = A032766(n)^2 - A032766(n^2). - Bruno Berselli, Oct 21 2016
a(n) = Sum_{i=1..n-1; i odd} i. - Olivier Pirson, Nov 06 2017
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), n > 4. - Iain Fox, Dec 08 2017
E.g.f.: ((x^2 - x)*cosh(x) + (1 + x + x^2)*sinh(x))/4. - Stefano Spezia, Oct 07 2018

A075458 Domination number for queens' graph Q(n).

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 4, 5, 5, 5, 5, 6, 7, 8, 9, 9, 9, 9, 10, 11, 11, 12, 12, 13, 13
Offset: 1

Views

Author

N. J. A. Sloane, Oct 16 2002

Keywords

Comments

From Dmitry Kamenetsky, Sep 03 2019: (Start)
Minimum number of queens needed to occupy or attack all squares of an n X n chessboard.
a(n) >= ceiling(n/2) for all n, except n = 3, 11. See paper by Finozhenok and Weakley below.
a(n) = p or p+1, where p = ceiling(n/2), proved for all n <= 132, except n = 3, 11. See paper by Ostergard and Weakley below. Note that this implies that a(n+4) > a(n). (End)

References

  • W. W. R. Ball and H. S. M. Coxeter, "Math'l Rec. and Essays," 13th Ed. Dover, p. 173.
  • John Watkins, Across the Board: The Mathematics of Chessboard Problems (2004), pp. 113-137

Crossrefs

A002563 gives number of solutions.
Cf. A075324 (independent domination number).

Extensions

a(19) from Peter Karpov, Mar 01 2016
a(20)-a(24) from Bird and a(25) from Dmitry Kamenetsky's file added by Andrey Zabolotskiy, Sep 03 2021

A075561 Domination number for kings' graph K(n).

Original entry on oeis.org

1, 1, 1, 4, 4, 4, 9, 9, 9, 16, 16, 16, 25, 25, 25, 36, 36, 36, 49, 49, 49, 64, 64, 64, 81, 81, 81, 100, 100, 100, 121, 121, 121, 144, 144, 144, 169, 169, 169, 196, 196, 196, 225, 225, 225, 256, 256, 256, 289, 289, 289, 324, 324, 324, 361, 361, 361, 400, 400
Offset: 1

Views

Author

N. J. A. Sloane, Oct 16 2002

Keywords

Comments

Also the lower independence number of the n X n knight graph. - Eric W. Weisstein, Aug 01 2023

References

  • John J. Watkins, Across the Board: The Mathematics of Chessboard Problems, Princeton University Press, 2004, p. 102.

Crossrefs

Programs

  • Mathematica
    Table[Floor[(n + 2)/3]^2, {n, 50}] (* Vaclav Kotesovec, May 13 2012 *)
    LinearRecurrence[{1, 0, 2, -2, 0, -1, 1}, {1, 1, 1, 4, 4, 4, 9}, 20] (* Eric W. Weisstein, Jun 20 2017 *)
    CoefficientList[Series[(-1 - x^3)/((-1 + x)^3 (1 + x + x^2)^2), {x, 0, 20}], x] (* Eric W. Weisstein, Jun 20 2017 *)
  • PARI
    Vec(-x*(x+1)*(x^2-x+1)/((x-1)^3*(x^2+x+1)^2) + O(x^100)) \\ Colin Barker, Oct 06 2014

Formula

a(n) = floor((n+2)/3)^2. - Vaclav Kotesovec, May 13 2012
G.f.: -x*(x+1)*(x^2-x+1) / ((x-1)^3*(x^2+x+1)^2). - Colin Barker, Oct 06 2014
E.g.f.: exp(-x/2)*(exp(3*x/2)*(5 + 3*x*(3 + x)) + (6*x - 5)*cos(sqrt(3)*x/2) + sqrt(3)*(3 + 2*x)*sin(sqrt(3)*x/2))/27. - Stefano Spezia, Oct 17 2022
Sum_{n>=1} 1/a(n) = Pi^2/2 (A102753). - Amiram Eldar, Nov 03 2022

Extensions

More terms added from Vaclav Kotesovec, May 13 2012

A201629 a(n) = n if n is even and otherwise its nearest multiple of 4.

Original entry on oeis.org

0, 0, 2, 4, 4, 4, 6, 8, 8, 8, 10, 12, 12, 12, 14, 16, 16, 16, 18, 20, 20, 20, 22, 24, 24, 24, 26, 28, 28, 28, 30, 32, 32, 32, 34, 36, 36, 36, 38, 40, 40, 40, 42, 44, 44, 44, 46, 48, 48, 48, 50, 52, 52, 52, 54, 56, 56, 56, 58, 60, 60, 60, 62, 64, 64, 64, 66, 68, 68
Offset: 0

Views

Author

Vaclav Kotesovec, Dec 03 2011

Keywords

Comments

For n > 1, the maximal number of nonattacking knights on a 2 x (n-1) chessboard.
Compare this with the binary triangle construction of A240828.
Minimal number of straight segments in a rook circuit of an (n-1) X n board (see example). - Ruediger Jehn, Feb 26 2021

Examples

			G.f. = 2*x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 6*x^6 + 8*x^7 + 8*x^8 + 8*x^9 + ...
From _Ruediger Jehn_, Feb 26 2021: (Start)
a(5) = 4:
   +----+----+----+----+----+
   |  __|____|_   |   _|__  |
   | /  |    | \  |  / |  \ |
   +----+----+----+----+----+
   | \__|__  | |  |  | |  | |
   |    |  \ | \__|__/ |  | |
   +----+----+----+----+----+
   |  __|__/ |  __|__  |  | |
   | /  |    | /  |  \ |  | |
   +----+----+----+----+----+
   | \  |    | |  |  | |  | |
   |  \_|____|_/  |  \_|__/ |
   +----+----+----+----+----+
There are at least 4 squares on the 4 X 5 board with straight lines (here in squares a_12, a_25, a_35 and a_42).  (End)
		

Crossrefs

Programs

  • Haskell
    a201629 = (* 2) . a004524 . (+ 1) -- Reinhard Zumkeller, Aug 05 2014
    
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(2*x^2/((1-x)^2*(1+x^2)))); // G. C. Greubel, Aug 13 2018
  • Maple
    seq(n-sin(Pi*n/2), n=0..30); # Robert Israel, Jul 14 2015
  • Mathematica
    Table[2*(Floor[(Floor[(n + 1)/2] + 1)/2] + Floor[(Floor[n/2] + 1)/2]), {n, 1, 100}]
    Table[If[EvenQ[n], n, 4*Round[n/4]], {n, 0, 68}] (* Alonso del Arte, Jan 27 2012 *)
    CoefficientList[Series[2 x^2/((-1 + x)^2 (1 + x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 06 2014 *)
    a[ n_] := n - KroneckerSymbol[ -4, n]; (* Michael Somos, Jul 18 2015 *)
  • PARI
    a(n)=n\4*4+[0, 0, 2, 4][n%4+1] \\ Charles R Greathouse IV, Jan 27 2012
    
  • PARI
    {a(n) = n - kronecker( -4, n)}; /* Michael Somos, Jul 18 2015 */
    

Formula

a(n) = n - sin(n*Pi/2).
G.f.: 2*x^2/((1-x)^2*(1+x^2)).
a(n) = 2*A004524(n+1). - R. J. Mathar, Feb 02 2012
a(n) = n+(1-(-1)^n)*(-1)^((n+1)/2)/2. - Bruno Berselli, Aug 06 2014
E.g.f.: x*exp(x) - sin(x). - G. C. Greubel, Aug 13 2018

Extensions

Formula corrected by Robert Israel, Jul 14 2015

A006075 Minimal number of knights needed to cover an n X n board.

Original entry on oeis.org

1, 4, 4, 4, 5, 8, 10, 12, 14, 16, 21, 24, 28, 32, 36, 40, 46, 52, 57, 62, 68
Offset: 1

Views

Author

Keywords

Comments

How many knights are needed to occupy or attack every square of an n X n board?
Also known as the domination number of the n X n knight graph. - Eric W. Weisstein, May 27 2016
Upper bounds for the terms after a(20) = 62 are as follows: 68, 75, 82, 88, 96, 102, ... (see Frank Rubin's web site).
The value a(15) = 37 given by Jackson and Pargas is wrong. A simulated annealing-based program I wrote found several complete coverages of a 15 X 15 board with 36 knights. - John Danaher (jsd(AT)mit.edu), Oct 24 2000

Examples

			Illustrations for a(3) = 4, a(4) = 4, a(5) = 5 (o = empty square, X = knight):
ooo .. oooo .. ooooo
oXo .. oXXo .. ooXoo
XXX .. oXXo .. oXXXo
...... oooo .. ooXoo
.............. ooooo
		

References

  • David C. Fisher, On the N X N Knight Cover Problem, Ars Combinatoria 69 (2003), 255-274.
  • M. Gardner, Mathematical Magic Show. Random House, NY, 1978, p. 194.
  • Anderson H. Jackson and Roy P. Pargas, Solutions to the N x N Knights Cover Problem, J. Recreat. Math., Vol. 23(4), 1991, 255-267.
  • Bernard Lemaire, Knights Covers on N X N Chessboards, J. Recreat. Math., Vol. 31-2, 2003, 87-99.
  • Frank Rubin, Improved knight coverings, Ars Combinatoria 69 (2003), 185-196.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • John Watkins, Across the Board: The Mathematics of Chessboard Problems (2004), p. 97.

Crossrefs

A006076 gives number of inequivalent ways to cover the board using a(n) knights, A103315 gives total number.

Extensions

Terms (or bounds) through a(26) updated by Frank Rubin (contestcen(AT)aol.com), May 22 2002
a(20) added from the Contest Center web site by N. J. A. Sloane, Mar 02 2006
a(21) added by Andy Huchala, Jun 06 2021

A279409 Triangle read by rows: T(n,m) (n>=m>=1) = maximum number of nonattacking kings on an n X m toroidal board.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 4, 5, 3, 3, 3, 6, 6, 9, 3, 3, 3, 6, 7, 9, 10, 4, 4, 4, 8, 8, 12, 12, 16, 4, 4, 4, 8, 9, 12, 13, 16, 18, 5, 5, 5, 10, 10, 15, 15, 20, 20, 25, 5, 5, 5, 10, 11, 15, 16, 20, 22, 25, 27, 6, 6, 6, 12, 12, 18, 18, 24, 24, 30, 30, 36
Offset: 1

Views

Author

Andrey Zabolotskiy, Dec 16 2016

Keywords

Comments

Independence number of the kings' graph on toroidal n X m chessboard.
Right border T(n,n) is A189889.
For the usual non-toroidal case, the formula is ceiling(m/2)*ceiling(n/2).

Examples

			Triangle starts:
  1;
  1, 1;
  1, 1, 1;
  2, 2, 2, 4;
  2, 2, 2, 4, 5;
  3, 3, 3, 6, 6, 9;
  3, 3, 3, 6, 7, 9, 10;
  ...
		

References

  • John J. Watkins, Across the Board: The Mathematics of Chessboard Problem, Princeton University Press, 2004, pages 194-196.

Crossrefs

Programs

  • Mathematica
    T[1, 1] = 1; T[n_, m_]:= If[m==1, Floor[n/2], Floor[Min[m Floor[n/2], n Floor[m/2]]/2]]; Flatten[Table[T[n,m], {n, 1, 12},{m, 1,n}]] (* Indranil Ghosh, Mar 09 2017 *)
  • PARI
    tabl(nn) = {for(n=1, 12, for(m=1, n, print1(if(m==1,if(n==1, 1, floor(n/2)), floor(min(m*floor(n/2), n*floor(m/2))/2)),", ");); print();); };
    tabl(12); \\ Indranil Ghosh, Mar 09 2017
    
  • Python
    def T(n,m):
        if m==1:
            if n==1: return 1
            return n//2
        return min(m*(n//2), n*(m//2))//2
    i=1
    for n in range(1,126):
        for m in range(1, n+1):
            print(i, T(n,m))
            i+=1 # Indranil Ghosh, Mar 09 2017

Formula

T(n,m) = floor(min(m*floor(n/2), n*floor(m/2))/2) for m>1;
T(n,1) = floor(n/2) for n>1.

A308578 Maximum number of non-overlapping circles of radius 1/n that can be placed inside a unit square.

Original entry on oeis.org

0, 1, 1, 4, 5, 9, 10, 16, 20, 25, 30, 36
Offset: 1

Views

Author

Ethan D. Kidd, Jun 08 2019

Keywords

Comments

Alternatively described as the maximum number of circles of unit radius that can be placed inside a square of side length n.
It appears that the terms a(2) to a(8) are equal to the related terms of A189889.

Examples

			a(6)=9 because 9 circles of radius 1/6 can be placed in a 3 X 3 regular grid inside a unit square.
		

Crossrefs

Formula

a(2k) = A084617(k). - Jon E. Schoenfield, Jun 09 2019

A101201 Maximal number of kings in the toroidal king's graph on an n X n board such that each king is attacking no more than four other kings.

Original entry on oeis.org

0, 2, 5, 9, 15, 21, 28, 37, 47, 60, 71, 84
Offset: 1

Views

Author

Eugen J. Ionascu, Aug 12 2008

Keywords

Comments

All the numbers listed so far were calculated using LpSolveIDE. It can be shown that the sequence of densities a(n)/n^2 has a limit as n goes to infinity, which is the supremum of all the elements in the sequence. With the help of the computer, it was shown that a(n) is not more than 0.608956n^2.

Examples

			a(2)=2 because one can check that any arrangement of two kings will satisfy the requirement but any arrangement of three kings will not.
		

Crossrefs

Formula

a(n) is approximately 3n^2/5 (conjecture).
Showing 1-8 of 8 results.