login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A201629 a(n) = n if n is even and otherwise its nearest multiple of 4. 13
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

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.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..1000

Craig Knecht, Row sums of superimposed and added binary filled triangles.

V. Kotesovec, Non-attacking chess pieces

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

EXAMPLE

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 + ...

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 *)

PROG

(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 */

(Haskell)

a201629 = (* 2) . a004524 . (+ 1) -- Reinhard Zumkeller, Aug 05 2014

(MAGMA) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(2*x^2/((1-x)^2*(1+x^2)))); // G. C. Greubel, Aug 13 2018

CROSSREFS

Cf. A004524, A085801, A189889, A190394.

Sequence in context: A235790 A023988 A023819 * A033827 A008217 A170889

Adjacent sequences:  A201626 A201627 A201628 * A201630 A201631 A201632

KEYWORD

nonn,easy

AUTHOR

Vaclav Kotesovec, Dec 03 2011

EXTENSIONS

Formula corrected by Robert Israel, Jul 14 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 16 18:24 EDT 2019. Contains 327116 sequences. (Running on oeis4.)