OFFSET
0,3
COMMENTS
The corresponding minimum value of f(P) is given by A000292(n)=binomial(n+3,3).
The number of distinct values of f(P) is given by A087034.
Also, number of (w,x,y) with all terms in {0,...,n-1} and 2|w-x| <= max(w,x,y)-min(w,x,y). For a guide to related sequences, see A212959. - Clark Kimberling, Jun 10 2012
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
FORMULA
From Clark Kimberling, Jun 10 2012: (Start)
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5).
G.f.: (x + x^2 + 3*x^3 - x^4)/(((1 - x)^4)*(1 + x)).
a(n+1) + A213045(n) = (n+1)^3. (End)
a(n) = (2*(n-1)*(n+1)*(2*n+3)-3*(-1)^n+9)/12. - Bruno Berselli, Jun 11 2012
EXAMPLE
a(3)=13, since f takes on the values 10 and 13: f({1,2,3})=10, f({1,3,2})=13, f({2,1,3})=13, f({2,3,1})=13, f({3,1,2})=13 and f({3,2,1})=10.
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Max[w, x, y] - Min[w, x, y] >= 2 Abs[w - x],
s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 45]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John W. Layman, Jul 31 2003
EXTENSIONS
a(11) and a(12) from R. J. Mathar, Jun 26 2012
Merged with a sequence of Clark Kimberling by Max Alekseyev, Jun 27 2012
a(0)=0 prepended by Alois P. Heinz, Aug 24 2024
STATUS
approved