alts = ...
@(n)(-[-1:1]'*[1:n])(n)

alts(1)
alts(12)
alts(77)
alts(135)
alts(297)
