June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,26 @@
function factor(n_) {
n = n_
a = J(0,2,.)
if (n<2) {
return(a)
}
else if (n<4) {
return((n,1))
}
else {
if (mod(n,2)==0) {
for (i=0; mod(n,2)==0; i++) n = floor(n/2)
a = a\(2,i)
}
for (k=3; k*k<=n; k=k+2) {
if (mod(n,k)==0) {
for (i=0; mod(n,k)==0; i++) n = floor(n/k)
a = a\(k,i)
}
}
if (n>1) a = a\(n,1)
return(a)
}
}