|
|
════════════════ F7: 340282366920938463463374607431768211457 ═════════════════
■ ■ ■ (the REXX program stopped via Ctrl─Alt─Break) ■ ■ ■
</pre>
=={{header|Ring}}==
{{Incorrect|Ring|Incorrect values for F(6) through F(8). Missing F(9) with no explanation. No attempt at all for second part of task. Up to F(5) should be doable for just about any language}}
<lang ring>
load "stdlib.ring"
decimals(0)
limit = 8
for n = 0 to limit
fermat = pow(2,pow(2,n))+1
see "F(" + n + ") = " + fermat + nl
next
</lang>
Output:
<pre>
F(0) = 3
F(1) = 5
F(2) = 17
F(3) = 257
F(4) = 65537
F(5) = 4294967297
F(6) = 18446744073709551616
F(7) = 340282366920938463463374607431768211456
F(8) = 115792089237316195423570985008687907853269984665640564039457584007913129639936
</pre>
|