Handbook
Glossary
chakravala ( n x p q m -- n x' p' q' m' )
Vocabulary
project-euler
.
066
Inputs
n
an
object
x
an
object
p
an
object
q
an
object
m
an
object
Outputs
n
an
object
x'
an
object
p'
an
object
q'
an
object
m'
an
object
Definition
USING:
math
math.functions
math.order
;
IN:
project-euler.066
::
chakravala
( n x p q m -- n x' p' q' m' )
n
sqrt
ceiling
>integer
:>
upper-bound upper-bound m
abs
-
:>
lower-bound x
neg
m
abs
rem
:>
reminder lower-bound reminder
-
:>
distance reminder distance m
abs
/
ceiling
0
max
m
abs
*
+
:>
x' n x' p x'
*
n q
*
+
m
abs
/
p x' q
*
+
m
abs
/
x'
sq
n
-
m
/
;