OFFSET
1,7
LINKS
A. Blecher, C. Brennan, and A. Knopfmacher, Peaks in bargraphs, Trans. Royal Soc. South Africa, 71, No. 1, 2016, 97-103.
FORMULA
G.f.: -(4*x^6*(3-2*x^3+3*x^4 - sqx + x^2*(4-3*sqx) + 2*x*(sqx - 4))/((x^2-3*x+1)*sqx*(-1+2*x+x^2-sqx)^3)) where sqx = sqrt(x^4+2*x^2-4*x+1).
EXAMPLE
a(6)=1 since the bargraph with column heights 2,1,2 has a distance of 1 between first and last peak. All other bargraphs of semiperimeter 6 have at most one peak, hence 0 difference.
PROG
(PARI) my(x = 'x + O('x^30)); sqx = sqrt(x^4+2*x^2-4*x+1); concat(vector(5), Vec(-(4*x^6*(3-2*x^3+3*x^4 - sqx + x^2*(4-3*sqx) + 2*x*(sqx - 4))/((x^2-3*x+1)*sqx*(-1+2*x+x^2-sqx)^3)))) \\ Michel Marcus, Feb 25 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Arnold Knopfmacher, Nov 08 2016
STATUS
approved