Handbook
Glossary
brute-force-factors ( n -- seq )
Vocabulary
math
.
primes
.
brute-force
Inputs
n
an
object
Outputs
seq
an
object
Definition
USING:
arrays
kernel
make
math
math.primes
math.primes.brute-force.private
;
IN:
math.primes.brute-force
:
brute-force-factors
( n -- seq )
[
2
[
2dup
sq
<
]
[
write-factor
next-prime
]
until
drop
dup
2
<
[
drop
]
[
1
2array
,
]
if
]
{
}
make
;