(MAGMAMagma) [((n-1)*n*(2*n*(2*n-5)-3*(-1)^n+11)-2*(-1)^n+2)/4: n in [0..40]]; // Vincenzo Librandi, Nov 16 2014
(MAGMAMagma) [((n-1)*n*(2*n*(2*n-5)-3*(-1)^n+11)-2*(-1)^n+2)/4: n in [0..40]]; // Vincenzo Librandi, Nov 16 2014
reviewed
approved
proposed
reviewed
editing
proposed
t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[(w != # && x != # && y != # && z != #) &[Max[w, x, y, z] - Min[w, x, y, z]], s++], {w, 0, n}, {x, 0, n}, {y, 0, n}, {z, 0, n}]; s)]]; Map[t[#] &, Range[0, 40]] (* _Peter J. C. Moses_, May 24 2012 *)
If[(w != # && x != # && y != # && z != #) &[
Max[w, x, y, z] - Min[w, x, y, z]], s++], {w, 0, n},
{x, 0, n}, {y, 0, n}, {z, 0, n}]; s)]];
Map[t[#] &, Range[0, 40]]
(* Peter J. C. Moses, May 24 2012 *)
proposed
editing
editing
proposed
Number of (w,x,y,z) with all terms in {0,...,n} and such that range{w,x,y,z} is not one of the numbers w,x,y,z.
(* _Peter J. C. Moses_, May 24 2012 *)
proposed
editing
editing
proposed
CoefficientList[Series[(- x - 25 x^3 - 36 x^4 - 79 x^5 - 36 x^6 - 15 x^7) / ((-1 + x)^5 (1 + x)^3), {x, 0, 40}], x] (* Vincenzo Librandi, Nov 16 2014 *)
(MAGMA) [((n-1)*n*(2*n*(2*n-5)-3*(-1)^n+11)-2*(-1)^n+2)/4: n in [0..40]]; // Vincenzo Librandi, Nov 16 2014
proposed
editing
editing
proposed