/* binom.c 28/dec/92
polynomial coeficients of
n-th power of (1+x) = 1 + n.x + n.(n-1)/2 .x.x + …
computation is performed in 8-cycle
first step: 1 0 0 0 0 0 0 0 –>
second step: 1 1 0 0 0 0 0 0 –>
third step: 1 2 1 0 0 0 0 0 –>
etc.
*/
#include
#include
#include
int a,i;
main()
{
int A;
xpand(15); /* expand to the 8-cycle */
a= 0; /* set a=0 everywhere */
if (currentpoint== 0) a= 1; /* except of point 0 where a=1 */
for (i= 0; i< 5; /* for i=0 to 4 */
A= a, trans(15), a+= A, i++); /* pick up the value, transfer it */
/* and add to the neighboring a */
printf(„point %d %d\n”,currentpoint,a); /* display result */
retract(15); /* back to single ant */
quit(); /* quit */
}