The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A212133 Number of (w,x,y,z) with all terms in {1,...,n} and median=mean. 9
 0, 1, 8, 33, 88, 185, 336, 553, 848, 1233, 1720, 2321, 3048, 3913, 4928, 6105, 7456, 8993, 10728, 12673, 14840, 17241, 19888, 22793, 25968, 29425, 33176, 37233, 41608, 46313, 51360, 56761, 62528, 68673, 75208, 82145, 89496, 97273, 105488, 114153, 123280 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS For a guide to related sequences, see A211795. LINKS Reinhard Zumkeller, Table of n, a(n) for n = 0..10000 Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1). FORMULA a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). a(n) = n * (2*n^2 - 3*n + 2). - J. M. Bergot, Jun 22 2012 a(n) = A000384(n) + n*A000384(n-1). - Bruno Berselli, Jun 07 2013 a(n) = (A005917(n) + 1) / 2 for n > 0. - Reinhard Zumkeller, Nov 13 2014 G.f.: x*(1 + 4*x + 7*x^2) / (1 - x)^4. - Colin Barker, Dec 02 2017 EXAMPLE a(2) counts these 4-tuples:  (1,1,1,1), (1,1,2,2), (1,2,1,2), (2,1,1,2), (1,2,2,1), (2,1,2,1), (2,2,1,1), (2,2,2,2). MATHEMATICA t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[Apply[Plus, Rest[Most[Sort[{w, x, y, z}]]]]/2 == (w + x + y + z)/4, s = s + 1], {w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]]; Flatten[Map[{t[#]} &, Range[0, 50]]] (* A212133 *) (* Peter J. C. Moses, May 01 2012 *) PROG (PARI) a(n)=2*n^3-3*n^2+2*n; \\ Joerg Arndt, Jun 22 2012 (PARI) concat(0, Vec(x*(1 + 4*x + 7*x^2) / (1 - x)^4 + O(x^40))) \\ Colin Barker, Dec 02 2017 (Haskell) a212133 n = if n == 0 then 0 else (a005917 n + 1) `div` 2 -- Reinhard Zumkeller, Nov 13 2014 CROSSREFS Cf. A211795. Cf. A226449. - Bruno Berselli, Jun 09 2013 Cf. A005917. Sequence in context: A212679 A204468 A140867 * A212574 A210698 A114105 Adjacent sequences:  A212130 A212131 A212132 * A212134 A212135 A212136 KEYWORD nonn,easy AUTHOR Clark Kimberling, May 04 2012 EXTENSIONS Closed form adapted to the offset by Bruno Berselli, Jun 07 2013 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 16 08:07 EDT 2021. Contains 343940 sequences. (Running on oeis4.)