Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Floyds-triangle/PARI-GP/floyds-triangle.parigp
Normal file
17
Task/Floyds-triangle/PARI-GP/floyds-triangle.parigp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{floyd(m)=my(lastrow_a,lastrow_e,lastrow_len=m,fl,idx);
|
||||
\\ +++ fl is a vector of fieldlengths in the last row
|
||||
lastrow_e=m*(m+1)/2;lastrow_a=lastrow_e+1-m;
|
||||
fl=vector(lastrow_len);
|
||||
for(k=1,m,fl[k] = 1 + #Str(k-1+lastrow_a) );
|
||||
\\
|
||||
idx=0;
|
||||
for(i=1,m,
|
||||
for(j=1,i,
|
||||
idx++;
|
||||
printf(Str("%" fl[j] "d"),idx)
|
||||
);
|
||||
print()
|
||||
);
|
||||
return();}
|
||||
floyd(5)
|
||||
floyd(14)
|
||||
Loading…
Add table
Add a link
Reference in a new issue