- or download this
use strict;
use warnings;
use Math::BigInt;
...
return acker( $i-1, 2) if $j <= 1;
return acker ($i - 1, acker ($i, $j - 1));
}
- or download this
$ perl pseudo_acker2.pl 2 3
Iteration 1: i = 2, j = 3
...
Iteration 5: i = 1, j = 4
Iteration 6: i = 1, j = 16
ackermann ( 2, 3) = 65536
- or download this
$ perl pseudo_acker2.pl 2 4
Iteration 1: i = 2, j = 4
Iteration 2: i = 2, j = 3
...
Iteration 7: i = 1, j = 16
Iteration 8: i = 1, j = 65536
ackermann ( 2, 4) = inf
- or download this
$ perl pseudo_acker2.pl 2 4
Iteration 1: i = 2, j = 4
Iteration 2: i = 2, j = 3
...
0570159318959639524863372367203002916969592156108764948889254090805911
+45703767520850020667156370236612635
9747144807111774815880914135742720967190151836282560618091458852699826
+14142503012339110827360384376787644
9043205960379124490905707560314035076162562476031863793126484703743782
+95497561377098160461441330869211810
- or download this
2485959152380195331030292162800160568670105651646750568038741529463842
+24484529253736144253361437372908830
3794601274724958414864915930647252015155693922628180691650796381064132
+27530726714399815850881129262890113
...
1852679054717169962990363015545645090044802789055701968328313630718997
+69915316667920895876857229060091547
2919636381673596673959975710326015571920237348580521128117458610065152
+59888384311451189488055212914577569
9146577530041384717124577965048175856395072895337539755822087777506072
+339445587895905719156736