a=1:100 b=outer(a,a,">=") for(i in a)if(i>2)for(j in 2:(i-1))b[i,j]=b[i-j,j]+b[i-1,j-1] write(paste("p(",a,")=",rowSums(b),sep=""),T)