Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1 @@
fact(n)=if(n<2,1,n*fact(n-1))

View file

@ -0,0 +1 @@
fact(n)=my(p=1);for(k=2,n,p*=k);p

View file

@ -0,0 +1 @@
fact(n)=factorback([2..n])

View file

@ -0,0 +1,11 @@
f( a, b )={
my(c);
if( b == a, return(a));
if( b-a > 1,
c=(b + a) >> 1;
return(f(a, c) * f(c+1, b))
);
return( a * b );
}
fact(n) = f(1, n)

View file

@ -0,0 +1 @@
fact(n)=n!

View file

@ -0,0 +1 @@
fact(n)=round(gamma(n+1))

View file

@ -0,0 +1,9 @@
fact(n)={
my(v=vector(n+1,i,i==1));
for(i=2,n+1,
forstep(j=i,2,-1,
for(k=2,j,v[k]+=v[k-1])
)
);
v[n+1]
};