Handbook
Glossary
(consecutive) ( count goal test -- n )
Vocabulary
project-euler
.
047
.
private
Inputs
count
an
object
goal
an
object
test
an
object
Outputs
n
an
object
Definition
USING:
kernel
math
math.primes
math.primes.factors
sequences
;
IN:
project-euler.047.private
:
(consecutive)
( count goal test -- n )
2over
=
[
swap
-
nip
]
[
dup
prime?
[
[
drop
0
]
2dip
]
[
2dup
unique-factors
length
=
[
[
1
+
]
2dip
]
[
[
drop
0
]
2dip
]
if
]
if
1
+
(consecutive)
]
if
;