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 A213041 #52 Oct 01 2023 18:24:18 %S A213041 1,2,7,12,21,30,43,56,73,90,111,132,157,182,211,240,273,306,343,380, %T A213041 421,462,507,552,601,650,703,756,813,870,931,992,1057,1122,1191,1260, %U A213041 1333,1406,1483,1560,1641,1722,1807,1892,1981,2070,2163,2256 %N A213041 Number of triples (w,x,y) with all terms in {0..n} and 2*|w-x| = max(w,x,y) - min(w,x,y). %C A213041 See A212959 for a guide to related sequences. %C A213041 For n > 3, a(n-2) is the number of distinct values of the magic constant in a perimeter-magic (n-1)-gon of order n (see A342819). - _Stefano Spezia_, Mar 23 2021 %H A213041 Terrel Trotter, <a href="https://web.archive.org/web/20070106085340/http://www.trottermath.net/simpleops/pmp.html">Perimeter-Magic Polygons</a>, Journal of Recreational Mathematics Vol. 7, No. 1, 1974, pp. 14-20 (see equations 10-13). %H A213041 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1). %F A213041 a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3. %F A213041 G.f.: (1 + 3*x^2)/((1 - x)^3 * (1 + x)). %F A213041 a(n) = (n+1)^2 - 2*A004526(n-1) - 2. - _Wesley Ivan Hurt_, Jul 15 2013 %F A213041 a(n) = A002620(n+2) + 3*A002620(n). - _R. J. Mathar_, Jul 15 2013 %F A213041 a(n)+a(n+1) = A058331(n+1). - _R. J. Mathar_, Jul 15 2013 %F A213041 a(n) = n*(n+1) + (1+(-1)^n)/2. - _Wesley Ivan Hurt_, May 06 2016 %F A213041 E.g.f.: x*(x + 2)*exp(x) + cosh(x). - _Ilya Gutkovskiy_, May 06 2016 %F A213041 a(n) = A000384(n+1) - A137932(n+2). - _Federico Provvedi_, Aug 17 2023 %t A213041 t = Compile[{{n, _Integer}}, Module[{s = 0}, %t A213041 (Do[If[Max[w, x, y] - Min[w, x, y] == 2 Abs[w - x], %t A213041 s = s + 1], %t A213041 {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]]; %t A213041 m = Map[t[#] &, Range[0, 45]] (* A213041 *) %o A213041 (PARI) Vec((1+3*x^2)/((1-x)^3*(1+x)) + O(x^99)) \\ _Altug Alkan_, May 06 2016 %Y A213041 Cf. A002620, A004526, A058331, A212959, A168277 (first differences), A342819. %K A213041 nonn,easy %O A213041 0,2 %A A213041 _Clark Kimberling_, Jun 10 2012