OFFSET
0,2
COMMENTS
a(n) is the number of solutions in integers (x,y,z) of |x| + 2|y| + 3|z| = |n|. - Michael Somos, Jul 17 2018
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000
M. D. Hirschhorn, Basis partitions and Rogers-Ramanujan partitions, Discrete Math. 205 (1999), 241-243.
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
For n>0, a(n) = 2*(1+floor(n^2/3)) = 2*A087483(n-1) = 2*(1+A000212(n)). - Max Alekseyev, Dec 05 2013
G.f.: (1+x)*(1+x^2)*(1+x^3)/((1-x)*(1-x^2)*(1-x^3)) = (1+x)*(1+x^2)*(1-x+x^2)/((1-x)^3*(1+x+x^2)).
From Michael Somos, Jul 17 2018: (Start)
Euler transform of length 6 sequence [2, 1, 2, -1, 0, -1].
a(n+1) - 2*a(n) + a(n-1) = 1 + (-1)^n if |n|>1.
a(n) = a(-n) for all n in Z. (End)
EXAMPLE
G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 12*x^4 + 18*x^5 + 26*x^6 + 34*x^7 + ... - Michael Somos, Jul 17 2018
MATHEMATICA
LinearRecurrence[{2, -1, 1, -2, 1}, {1, 2, 4, 8, 12, 18}, 60] (* Harvey P. Dale, Aug 25 2015 *)
a[ n_] := 2 Quotient[ n^2, 3] + 2 - Boole[n == 0]; (* Michael Somos, Jul 17 2018 *)
a[ n_] := SeriesCoefficient[ (1 + x^2) (1 + x^3) / ((1 - x)^3 (1 + x + x^2)), {x, 0, Abs@n}]; (* Michael Somos, Jul 17 2018 *)
a[ n_] := Length @ FindInstance[ Abs[x] + 2 Abs[y] + 3 Abs[z] == Abs[n], {x, y, z}, Integers, 10^9]; (* Michael Somos, Jul 17 2018 *)
PROG
(PARI) {a(n) = n^2 \ 3 * 2 + 2 - (n==0)}; /* Michael Somos, Jul 17 2018 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
James A. Sellers, Mar 27 2000
STATUS
approved