OFFSET
0,4
COMMENTS
For a guide to related sequences, see A211422.
Also, number of ordered pairs (w,x) with both terms in {1,...,n} and w+2x divisible by 5. - Pontus von Brömssen, Jan 17 2020
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,1,-2,1).
FORMULA
a(n) = 2*a(n-1) - a(n-2) + a(n-5) - 2*a(n-6) + a(n-7).
G.f.: x^2*(1 + x^2 - x^3 + x^4) / ((1 - x)^3*(1 + x + x^2 + x^3 + x^4)). - Colin Barker, Dec 02 2017
MATHEMATICA
t[n_] := t[n] = Flatten[Table[w + 2 x - 5 y, {w, 1, n}, {x, 1, n}, {y, 1, n}]]
c[n_] := Count[t[n], 0]
t = Table[c[n], {n, 0, 70}] (* A211523 *)
FindLinearRecurrence[t]
LinearRecurrence[{2, -1, 0, 0, 1, -2, 1}, {0, 0, 1, 2, 4, 5, 7}, 57] (* Ray Chandler, Aug 02 2015 *)
PROG
(PARI) concat(vector(2), Vec(x^2*(1 + x^2 - x^3 + x^4) / ((1 - x)^3*(1 + x + x^2 + x^3 + x^4)) + O(x^40))) \\ Colin Barker, Dec 02 2017
(Magma) a:=[]; for n in [0..57] do m:=0; for i, j in [1..n] do if (i+2*j) mod 5 eq 0 then m:=m+1; end if; end for; Append(~a, m); end for; a; // Marius A. Burtea, Jan 17 2020
(Magma) R<x>:=PowerSeriesRing(Integers(), 57); [0, 0] cat Coefficients(R!( x^2*(1 + x^2 - x^3 + x^4) / ((1 - x)^3*(1 + x + x^2 + x^3 + x^4) ))); // Marius A. Burtea, Jan 17 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 14 2012
STATUS
approved