?'+)=:!@/*"*'6/{=+'+}/{
オンラインでお試しください!
説明
展開:
? ' + )
= : ! @ /
* " * ' 6 /
{ = + ' + } /
{ . . . . .
. . . . .
. . . .
これは実際には/
、何らかのリダイレクトに使用される単なる線形プログラムです。線形コードは次のとおりです。
?'+){=+'+}*"*'6{=:!@
n(n + 1)(2n + 1)/ 6を計算します。次のメモリエッジを使用します。

メモリポイント(MP)は、北を指すnというラベルの付いたエッジから始まります。
? Read input into edge labelled 'n'.
' Move MP backwards onto edge labelled 'n+1'.
+ Copy 'n' into 'n+1'.
) Increment the value (so that it actually stores the value n+1).
{= Move MP forwards onto edge labelled 'temp' and turn around to face
edges 'n' and 'n+1'.
+ Add 'n' and 'n+1' into edge 'temp', so that it stores the value 2n+1.
' Move MP backwards onto edge labelled '2n+1'.
+ Copy the value 2n+1 into this edge.
} Move MP forwards onto 'temp' again.
* Multiply 'n' and 'n+1' into edge 'temp', so that it stores the value
n(n+1).
" Move MP backwards onto edge labelled 'product'.
* Multiply 'temp' and '2n+1' into edge 'product', so that it stores the
value n(n+1)(2n+1).
' Move MP backwards onto edge labelled '6'.
6 Store an actual 6 there.
{= Move MP forwards onto edge labelled 'result' and turn around, so that
the MP faces edges 'product' and '6'.
: Divide 'product' by '6' into 'result', so that it stores the value
n(n+1)(2n+1)/6, i.e. the actual result.
! Print the result.
@ Terminate the program.
理論的には、このプログラムをサイドレングス3に適合させることが可能かもしれません。なぜなら、/
これらは計算に必要ではなく:
、プログラムを終了するために再利用でき、また一部は'"=+*{
再利用可能で、必要な数の19以下のコマンド(サイドレングス3の最大値)。ただし、そのような解決策が存在する場合、それを手作業で見つけることは不可能です。
f(1) == 1 * 1 (1)
、とf(24) == 70 * 70 (4900)
。