Handbook
Glossary
prime-triples ( n -- answer )
Vocabulary
project-euler
.
087
.
private
Inputs
n
an
object
Outputs
answer
an
object
Definition
USING:
math
math.functions
math.primes
sequences
sets
;
IN:
project-euler.087.private
::
prime-triples
( n -- answer )
n
sqrt
primes-upto
:>
primes primes 2 n
prime-powers-less-than
:>
primes^2 primes 3 n
prime-powers-less-than
:>
primes^3 primes 4 n
prime-powers-less-than
:>
primes^4 primes^2 primes^3
[
+
]
cartesian-map
concat
primes^4
[
+
]
cartesian-map
concat
[
n
<=
]
filter
members
length
;