Handbook
Glossary
(euler151) ( x -- y )
Vocabulary
project-euler
.
151
Inputs
x
an
object
Outputs
y
an
object
Definition
USING:
assocs
combinators
kernel
math
namespaces
sequences
;
IN:
project-euler.151
:
(euler151)
( x -- y )
table
get
[
{
{
{
0 0 0 1
}
[
0
]
}
{
{
0 0 1 0
}
[
{
0 0 0 1
}
(euler151)
1
+
]
}
{
{
0 1 0 0
}
[
{
0 0 1 1
}
(euler151)
1
+
]
}
{
{
1 0 0 0
}
[
{
0 1 1 1
}
(euler151)
1
+
]
}
[
[
dup
length
<iota>
[
pick-sheet
]
with
map-sum
]
[
sum
]
bi
/
]
}
case
]
cache
;