OFFSET
0,3
COMMENTS
Old name was: If n mod 3 = 0 then 6*(n/3)^2 elif n mod 3 = 1 then 6*((n-2)/3)^2+8*(n-2)/3 + 3 else 6*((n-1)/3)^2+4*(n-1)/3+1.
From Ray G. Opao, Oct 20 2022: (Start)
For n >= 3, a(n) is the maximum number of objects that can be placed on an n X n grid such that no 3 adjacent grid points on the same row or column are occupied.
The first 5 terms of this description are illustrated in the Opao link. (End)
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
S. Lafortune, A. Ramani, B. Grammaticos, Y. Ohta and K. M. Tamizhmani, Blending two discrete integrability criteria: singularity confinement and algebraic entropy, arXiv:nlin/0104020 [nlin.SI], 2001.
Ray G. Opao, Illustration for first 5 terms of comment
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
From Vladeta Jovovic, Jun 23 2002: (Start)
a(n) = (2/3)*n^2 if n mod 3 = 0, otherwise (2/3)*n^2 + 1/3.
Recurrence: a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
G.f.: x*(1 + x)*(1 + x^2)/(1 + x + x^2)/(1 - x)^3. (End)
a(n) = ceiling(2*n^2 / 3). - Wesley Ivan Hurt, Jun 20 2013
a(n) + a(n+1) + a(n+2) = A005893(n+1). - R. J. Mathar, Mar 01 2014
a(n+1) = A156040(2*n). - L. Edson Jeffery, Jul 30 2014
Let F(x,y) = 6*((x-y)/3)^2 + 4*y*(x-y)/3 + y*(y+1)/2; then a(n) = F(n,(n mod 3)). - R. J. Cano, Jul 30 2014
a(n) = Sum_{j=1..n} Sum_{i=1..n} ceiling((i+j-n)/3). - Wesley Ivan Hurt, Mar 12 2015
a(n) = n^2 - floor(n^2/3) = (2/9)*(3*n^2 + 1 - cos(2*Pi*n/3)). - Bruno Berselli, Jan 18 2017
E.g.f.: (2*exp(x)*(1 + 3*x*(1 + x)) - 2*exp(-x/2)*cos(sqrt(3)*x/2))/9. - Stefano Spezia, Oct 17 2022
Sum_{n>=1} 1/a(n) = Pi^2/36 + 3*c*sinh(c)/(1+2*cosh(c)), where c = Pi*sqrt(2)/3. - Amiram Eldar, Jan 08 2023
MAPLE
A071619 := proc(n) if n mod 3 = 0 then 6*(n/3)^2 elif n mod 3 = 1 then 6*((n-1)/3)^2+4*(n-1)/3+1 else 6*((n-2)/3)^2+8*(n-2)/3 +3; fi; end;
MATHEMATICA
f[n_] := Which[Divisible[n, 3], 6(n/3)^2, Mod[n, 3] == 1, 6(((n - 1)/3)^2) + 4 (n - 1)/3 + 1, True, 6((n - 2)/3)^2 + 8((n - 2)/3) + 3]; Array[f, 60, 0] (* or *) LinearRecurrence[{2, -1, 1, -2, 1}, {0, 1, 3, 6, 11}, 60] (* Harvey P. Dale, Feb 28 2012 *)
CoefficientList[Series[((x * (1 + x) * (1 + x^2))/((1 + x + x^2) * (1 - x)^3)), {x, 0, 53}], x] (* L. Edson Jeffery, Jul 30 2014 *)
Ceiling[2Range[0, 49]^2/3] (* Alonso del Arte, Mar 13 2015 *)
Table[n^2 - Floor[n^2/3], {n, 0, 60}] (* Bruno Berselli, Jan 18 2017 *)
PROG
(PARI) f=(x, y)->6*((x-y)/3)^2+4*y*(x-y)/3+y*(y+1)/2;
a(n)=f(n, n%3); \\ R. J. Cano, Jul 20 2014
(Magma) [Ceiling(2*n^2/3): n in [0..100]]; // Wesley Ivan Hurt, Mar 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 21 2002
EXTENSIONS
Corrected definition (Old Name) from Harvey P. Dale, Feb 28 2012
New name from Wesley Ivan Hurt, Mar 13 2015
STATUS
approved