%I #89 Jan 08 2023 02:41:54
%S 0,1,3,6,11,17,24,33,43,54,67,81,96,113,131,150,171,193,216,241,267,
%T 294,323,353,384,417,451,486,523,561,600,641,683,726,771,817,864,913,
%U 963,1014,1067,1121,1176,1233,1291,1350,1411,1473,1536,1601,1667,1734,1803,1873
%N a(n) = ceiling(2*n^2 / 3).
%C 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.
%C From _Ray G. Opao_, Oct 20 2022: (Start)
%C 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.
%C The first 5 terms of this description are illustrated in the Opao link. (End)
%H Vincenzo Librandi, <a href="/A071619/b071619.txt">Table of n, a(n) for n = 0..1000</a>
%H S. Lafortune, A. Ramani, B. Grammaticos, Y. Ohta and K. M. Tamizhmani, <a href="http://arXiv.org/abs/nlin.SI/0104020">Blending two discrete integrability criteria: singularity confinement and algebraic entropy</a>, arXiv:nlin/0104020 [nlin.SI], 2001.
%H Ray G. Opao, <a href="/A071619/a071619.txt">Illustration for first 5 terms of comment</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,1,-2,1).
%F From _Vladeta Jovovic_, Jun 23 2002: (Start)
%F a(n) = (2/3)*n^2 if n mod 3 = 0, otherwise (2/3)*n^2 + 1/3.
%F Recurrence: a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
%F G.f.: x*(1 + x)*(1 + x^2)/(1 + x + x^2)/(1 - x)^3. (End)
%F a(n) = ceiling(2*n^2 / 3). - _Wesley Ivan Hurt_, Jun 20 2013
%F a(n) + a(n+1) + a(n+2) = A005893(n+1). - _R. J. Mathar_, Mar 01 2014
%F a(n+1) = A156040(2*n). - _L. Edson Jeffery_, Jul 30 2014
%F 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
%F a(n) = Sum_{j=1..n} Sum_{i=1..n} ceiling((i+j-n)/3). - _Wesley Ivan Hurt_, Mar 12 2015
%F a(n) = n^2 - floor(n^2/3) = (2/9)*(3*n^2 + 1 - cos(2*Pi*n/3)). - _Bruno Berselli_, Jan 18 2017
%F 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
%F 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
%p 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;
%t 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 *)
%t 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 *)
%t Ceiling[2Range[0, 49]^2/3] (* _Alonso del Arte_, Mar 13 2015 *)
%t Table[n^2 - Floor[n^2/3], {n, 0, 60}] (* _Bruno Berselli_, Jan 18 2017 *)
%o (PARI) f=(x,y)->6*((x-y)/3)^2+4*y*(x-y)/3+y*(y+1)/2;
%o a(n)=f(n,n%3); \\ _R. J. Cano_, Jul 20 2014
%o (Magma) [Ceiling(2*n^2/3): n in [0..100]]; // _Wesley Ivan Hurt_, Mar 12 2015
%Y Partial sums of A042968.
%Y Essentially a bisection of A156040.
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_, Jun 21 2002
%E Corrected definition (Old Name) from _Harvey P. Dale_, Feb 28 2012
%E New name from _Wesley Ivan Hurt_, Mar 13 2015