4 lines
133 B
Forth
4 lines
133 B
Forth
func: semiprime(n)
|
|
| i |
|
|
0 2 n sqrt asInteger for: i [ while(n i /mod swap 0 &=) [ ->n 1+ ] drop ]
|
|
n 1 > ifTrue: [ 1+ ] 2 == ;
|