A212133 Number of (w,x,y,z) with all terms in {1,...,n} and median=mean.
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
Offset: 0
Examples
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).
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Z. Janelidze, F. van Niekerk, and J. Viljoen, What is the maximal connected partial symmetry index of a connected graph of a given size?, arXiv:2502.00704 [math.CO], 2025. See p. 4.
- Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
Crossrefs
Programs
-
Haskell
a212133 n = if n == 0 then 0 else (a005917 n + 1) `div` 2 -- Reinhard Zumkeller, Nov 13 2014
-
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 *)
-
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
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) = (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
Extensions
Closed form adapted to the offset by Bruno Berselli, Jun 07 2013
Comments