OFFSET
1,3
COMMENTS
For a guide to related sequences, see A211422.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1001
Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1,-1,1).
FORMULA
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6).
G.f.: x^2*(1 + x + x^3) / ((1 - x)^3*(1 + x)*(1 + x + x^2)). - Colin Barker, Dec 02 2017
a(n) = floor(((n-1)^2)/4) + floor((n-2)/3) + 1. - Ridouane Oudra, Jun 12 2020
EXAMPLE
For n = 4, 1 = 2*2-3*1, 2 = 2*4-3*2 and 3 = 2*3-3*1, so (1,2,1), (2,4,2) and (3,3,1) are solutions and a(4) = 3. - Bernard Schott, Jan 27 2020
MATHEMATICA
t[n_] := t[n] = Flatten[Table[w - 2 x + 3 y, {w, 1, n}, {x, 1, n}, {y, 1, n}]]
c[n_] := Count[t[n], 0]
t = Table[c[n], {n, 1, 80}] (* A211519 *)
FindLinearRecurrence[t]
LinearRecurrence[{1, 1, 0, -1, -1, 1}, {0, 1, 2, 3, 6, 8}, 56] (* Ray Chandler, Aug 02 2015 *)
PROG
(PARI) concat(0, Vec(x*(1 + x + x^3) / ((1 - x)^3*(1 + x)*(1 + x + x^2)) + O(x^60))) \\ Colin Barker, Dec 02 2017
(PARI) a(n)=(n-1)^2\4 + (n+1)\3 \\ Charles R Greathouse IV, Jun 12 2020
(Magma) [ #[<w, x, y>:w, x, y in [1..n]|w eq 2*x-3*y]: n in [1..56]]; // Marius A. Burtea, Jan 26 2020
(Magma) R<x>:=PowerSeriesRing(Integers(), 56); [0] cat Coefficients(R!(x^2*(1+x+x^3) / ((1-x)^3*(1+x)*(1+x+x^2)))); // Marius A. Burtea, Jan 26 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 14 2012
EXTENSIONS
Name and offset corrected by Pontus von Brömssen, Jan 26 2020
STATUS
approved