Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -28,5 +28,5 @@ function prime-decomposition ($n) {
|
|||
}
|
||||
$prime
|
||||
}
|
||||
"$(prime-decomposition 12)"
|
||||
"$(prime-decomposition 100)"
|
||||
"$(prime-decomposition 12)"
|
||||
"$(prime-decomposition 100)"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
function prime-decomposition ($n) {
|
||||
$values = [System.Collections.Generic.List[string]]::new()
|
||||
while ((($n % 2) -eq 0) -and ($n -gt 2)) {
|
||||
$values.Add(2)
|
||||
$n /= 2
|
||||
}
|
||||
for ($i = 3; $n -ge ($i * $i); $i += 2) {
|
||||
if (($n % $i) -eq 0){
|
||||
$values.Add($i)
|
||||
$n /= $i
|
||||
$i -= 2
|
||||
}
|
||||
}
|
||||
$values.Add($n)
|
||||
return $values
|
||||
}
|
||||
"$(prime-decomposition 1000000)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue