%I #5 Mar 23 2021 16:18:48
%S 4,4,7,6,9,10,6,11,12,13,8,13,16,17,16,8,15,18,21,20,19,10,17,22,25,
%T 26,25,22,10,19,24,29,30,31,28,25,12,21,28,33,36,37,36,33,28,12,23,30,
%U 37,40,43,42,41,36,31,14,25,34,41,46,49,50,49,46,41,34,14,27,36,45,50,55,56,57,54,51,44,37
%N Table read by ascending antidiagonals: T(k, n) is the number of distinct values of the magic constant in a perimeter-magic k-gon of order n.
%H 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).
%F O.g.f.: (1 - y + 2*x*(y^2 + y - 1) + x^2*(4*y^2 + y - 3))/((1 - x)^2*(1 + x)*(1 - y)^2*(1 + y)).
%F E.g.f.: (1 + x*(y - 2))*cosh(x + y) + cosh(y)*sinh(x) + x*(y - 2)*sinh(x + y).
%F T(k, n) = k*(n - 2) + ((k mod 2) - 1)*(n mod 2) + 1.
%F T(k, n) = A342758(k, n) - A342757(k, n) + 1.
%e The table begins:
%e k\n| 3 4 5 6 7 ...
%e ---+-------------------
%e 3 | 4 7 10 13 16 ...
%e 4 | 4 9 12 17 20 ...
%e 5 | 6 11 16 21 26 ...
%e 6 | 6 13 18 25 30 ...
%e 7 | 8 15 22 29 36 ...
%e ...
%t T[k_,n_]:=k(n-2)+(Mod[k,2]-1)Mod[n,2]+1;Table[T[k+3-n,n],{k,3,14},{n,3,k}]//Flatten
%Y Cf. A005408 (n = 4), A016813 (n = 6), A016921 (n = 8), A017077 (n = 10), A146951 (n = 7), A238290 (n = 9), A342757, A342758.
%K nonn,tabl
%O 3,1
%A _Stefano Spezia_, Mar 22 2021