Special factorials: Difference between revisions

m
use Int128 to prevent overflow
m (use Int128 to prevent overflow)
Line 143:
rf(n) = reverse_factorial(n)
 
println("N Superfactorial Hyperfactorial", " "^18, "Alternating Factorial Exponential Factorial\n", "-"^8898)
for n in 0:9
print(n, " ")
for f in [sf, H, af, n$]
if n < 5 || f != n$
print(rpad((f(Int128(n)), 25f == H ? 37 : 24))
end
end
Line 162:
</lang>{{out}}
<pre>
N Superfactorial Hyperfactorial Alternating Factorial Exponential Factorial
--------------------------------------------------------------------------------------------------
0 1 1 0 0 1
1 1 1 1 1 1
2 2 4 1 1 2
3 12 108 5 5 9
4 288 27648 19 19 262144
5 34560 86400000 101
6 24883200 4031078400000 619
7 125411328000 3319766398771200000 4421
8 5056584744960000 55696437941726556979200000 -907465429310504960 35899
9 1834933472251084800000 21577941222941856209168026828800000 326981
9 8705808953839190016 2649120435010011136 326981
 
The number of digits in n$(5) is 183231
4,105

edits