This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A212979 #29 Oct 27 2024 04:16:15 %S A212979 1,1,1,7,10,13,19,25,34,40,49,61,70,82,94,109,124,136,154,172,190,208, %T A212979 226,250,271,292,316,340,367,391,418,448,475,505,535,568,601,631,667, %U A212979 703,739,775,811,853,892,931,973,1015,1060,1102,1147,1195,1240 %N A212979 Number of (w,x,y) with all terms in {0,...,n} and range=average. %C A212979 For a guide to related sequences, see A212959. %H A212979 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-1,1,-2,2,-2,1). %F A212979 a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5) - 2*a(n-6) + 2*a(n-7) - 2*a(n-8) + a(n-9). %F A212979 G.f.: (1 - x + x^2 + 5*x^3 - 3*x^4 + 5*x^5 + x^6 - x^7 + x^8)/(1 - 2*x + 2*x^2 - 2*x^3 + x^4 - x^5 + 2*x^6 - 2*x^7 + 2*x^8 - x^9). %F A212979 From _Michael Somos_, Jan 25 2024: (Start) %F A212979 a(n) = a(-1-n) for all n in Z. %F A212979 G.f.: (1 + x)*(1 - x + x^2 + 5*x^3 - 3*x^4 + 5*x^5 + x^6 - x^7 + x^8)/((1 - x)*(1 - x^4)*(1 - x^5)). (End) %F A212979 For n > 2, a(n) = 3 * A368482(n+3) + 4. - _Helmut Ruhland_, Jan 31 2024 %e A212979 a(3)=7 counts these (w,x,y): (0,0,0) and the six permutations of (1,2,3). %e A212979 G.f. = 1 + x + x^2 + 7*x^3 + 10*x^4 + 13*x^5 + 19*x^6 + 25*x^7 + 34*x^8 + ... - _Michael Somos_, Jan 25 2024 %t A212979 t = Compile[{{n, _Integer}}, Module[{s = 0}, %t A212979 (Do[If[Max[w, x, y] - Min[w, x, y] == (w + x + y)/3, s = s + 1], %t A212979 {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]]; %t A212979 m = Map[t[#] &, Range[0, 60]] (* A212979 *) %t A212979 a[ n_] := If[n<0, a[-1-n], Sum[ Boole[Max[t] - Min[t] == Mean[t]], {t, Tuples[Range[0, n], 3]}]]; (* _Michael Somos_, Jan 25 2024 *) %t A212979 a[ n_] := (9*(n^2+n) + 6*{10, 7, 1, 12, 10, 5, 7, 6, 12, 5}[[1 + Min[Mod[n, 20], Mod[-1-n, 20]]]])/20 - 2; (* _Michael Somos_, Jan 25 2024 *) %o A212979 (PARI) {a(n) = (9*(n^2+n) + 6*[10, 7, 1, 12, 10, 5, 7, 6, 12, 5][1 + min(n%20, (-1-n)%20)])/20 - 2}; /* _Michael Somos_, Jan 25 2024 */ %Y A212979 Cf. A212959, A368482. %K A212979 nonn,easy %O A212979 0,4 %A A212979 _Clark Kimberling_, Jun 03 2012