OFFSET
0,2
COMMENTS
See A212959 for a guide to related sequences.
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
LINKS
Terrel Trotter, Perimeter-Magic Polygons, Journal of Recreational Mathematics Vol. 7, No. 1, 1974, pp. 14-20 (see equations 10-13).
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3.
G.f.: (1 + 3*x^2)/((1 - x)^3 * (1 + x)).
a(n) = (n+1)^2 - 2*A004526(n-1) - 2. - Wesley Ivan Hurt, Jul 15 2013
a(n)+a(n+1) = A058331(n+1). - R. J. Mathar, Jul 15 2013
a(n) = n*(n+1) + (1+(-1)^n)/2. - Wesley Ivan Hurt, May 06 2016
E.g.f.: x*(x + 2)*exp(x) + cosh(x). - Ilya Gutkovskiy, May 06 2016
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Max[w, x, y] - Min[w, x, y] == 2 Abs[w - x],
s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 45]] (* A213041 *)
PROG
(PARI) Vec((1+3*x^2)/((1-x)^3*(1+x)) + O(x^99)) \\ Altug Alkan, May 06 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 10 2012
STATUS
approved