OFFSET
0,2
COMMENTS
If n < a(m) then all integer solutions (i,j,k) of 2*i^2 + 2*j^2 + 3*k^2 - 2*i*k = n satisfy max(|i|,|j|,|k|) < m.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
G.f.: (2*x + 3*x^2 + 3*x^3 + 2*x^4)/((1-x)^2(1-x^3)).
a(-n) = a(n).
a(3n) = 15n^2, a(3n+1) = 15n^2 + 10n + 2.
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5), a(0)=0, a(1)=2, a(2)=7, a(3)=15, a(4)=27. - Harvey P. Dale, Nov 28 2013
a(n) = Sum_{j=1..n} Sum_{i=1..n} ceiling((i+j-n+3)/3). - Wesley Ivan Hurt, Mar 12 2015
MAPLE
MATHEMATICA
Floor[(5*Range[0, 50]^2+1)/3] (* or *) LinearRecurrence[{2, -1, 1, -2, 1}, {0, 2, 7, 15, 27}, 50] (* Harvey P. Dale, Nov 28 2013 *)
PROG
(PARI) a(n)=(5*n^2+1)\3
(Magma) [Floor((5*n^2+1)/3) : n in [0..100]]; // Wesley Ivan Hurt, Mar 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Oct 31 2005
STATUS
approved