Anonymous user
Floyd's triangle: Difference between revisions
→{{header|PARI/GP}}
Line 4,257:
=={{header|PARI/GP}}==
lastrow_e=m*(m+1)/2;lastrow_a=lastrow_e+1-m;
fl=vector(lastrow_len);
▲<lang parigp>{floyd(m)=my(lastrowa,lastrowe,vecFieldLen,idx);
\\
idx=0;
▲ for(k=1,m,fl[k]=1+#Str(k-1+lastrowa));
▲ for(i=2,m,
for(j=1,i,
printf(Str("%" fl[j]
);
print()
);
return();}
floyd(5)
floyd(14)
|