Handbook
Glossary
S ( n -- Sn )
Vocabulary
project-euler
.
463
Inputs
n
an
object
Outputs
Sn
an
object
Definition
USING:
combinators
kernel
math
;
IN:
project-euler.463
MEMO::
S
( n -- Sn )
n
{
{
-1
[
0
]
}
{
0
[
0
]
}
{
1
[
1
]
}
[
drop
n 2
/i
S
n 1
+
2
/i
S
2
*
+
n 1
-
2
/i
S
3
*
+
n 1
+
4
/i
S
2
*
-
n 1
-
4
/i
S
4
*
-
n 3
-
4
/i
S
2
*
-
1
-
]
}
case
;