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-2 of 2 results.

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

A352241 Maximal number of nonattacking black-square queens on an n X n chessboard.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47
Offset: 1

Views

Author

George Baloglou, Mar 09 2022

Keywords

Crossrefs

Cf. this sequence (maximal number for black-squares), A352325 (black-squares counts), A352426 (maximal number for white-squares), A352599 (white-squares counts).

Formula

Conjecture: a(5k)=4k-1, a(5k+1)=4k, a(5k+2)=4k+1, a(5k+3)=4k+1, a(5k+4)=4k+2. [This does not hold for n = 52 and n = 57. - Andy Huchala, Apr 02 2024]
a(n) = A053757(n-1), at least for 1 <= n <= 12. [This is unlikely to continue. - N. J. A. Sloane, Mar 11 2022] [Indeed the equality does not hold for n=13. - Martin Ehrenstein, Mar 11 2022]
a(n+1) >= a(n); a(2n) = A352426(2n). - Martin Ehrenstein, Mar 23 2022

Extensions

a(13)-a(26) from Martin Ehrenstein, Mar 11 2022
a(27)-a(28) from Martin Ehrenstein, Mar 15 2022
a(29)-a(30) from Martin Ehrenstein, Mar 23 2022
a(31)-a(60) from Andy Huchala, Mar 27 2024
Showing 1-2 of 2 results.