The letters "a", "b" "c" show the extra added onto the previous figure to grow its points. Each side except two are extended. In general the k-gonals increment by k-2 sides of i points, plus 1 at the end of the last side, so

P(i+1) = P(i) + (k-2)*i + 1

Second Kind

Option pairs => 'second' gives the polygonals of the second kind, which are the same formula but with a negative i.

S(i) = P(-i) = (k-2)/2 * i*(i-1) + (k-3)*i

The result is still positive values, bigger than the plain P(i). For example the pentagonals are 0,1,5,12,22,etc and the second pentagonals are 0,2,7,15,26,etc.

Both Kinds

pairs => 'both' gives the firsts and seconds interleaved. P(0) and S(0) are both 0 and that value is given just once at i=0, so

0, P(1), S(1), P(2), S(2), P(3), S(3), ...

Average

Option pairs => 'average' is the average of the first and second, which ends up being simply a multiple of the perfect squares,

A(i) = (P(i)+S(i))/2
= (k-2)/2 * i*i

This is an integer if k is even, or k odd and i is even. If k and i both odd then it's an 0.5 fraction.

SEE ALSO

HOME PAGE

LICENSE

Copyright 2010, 2011, 2012, 2013, 2014 Kevin Ryde

Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.