Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Topswops/PARI-GP/topswops.parigp
Normal file
14
Task/Topswops/PARI-GP/topswops.parigp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
flip(v:vec)={
|
||||
my(t=v[1]+1);
|
||||
if (t==2, return(0));
|
||||
for(i=1,t\2, [v[t-i],v[i]]=[v[i],v[t-i]]);
|
||||
1+flip(v)
|
||||
}
|
||||
topswops(n)={
|
||||
my(mx);
|
||||
for(i=0,n!-1,
|
||||
mx=max(flip(Vecsmall(numtoperm(n,i))),mx)
|
||||
);
|
||||
mx;
|
||||
}
|
||||
vector(10,n,topswops(n))
|
||||
Loading…
Add table
Add a link
Reference in a new issue