Skip to content

Commit 8686d1c

Browse files
author
kennyledet
committed
Merge pull request kennyledet#428 from sebasguts/master
Implemented Ackermann function in GAP
2 parents 8ba1d5c + 0095155 commit 8686d1c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Ackermann := function( m, n )
2+
3+
if m = 0 then
4+
return n + 1;
5+
elif m > 0 and n = 0 then
6+
return Ackermann( m - 1, 1 );
7+
fi;
8+
9+
return Ackermann( m - 1, Ackermann( m, n - 1 ) );
10+
11+
end;
12+
13+

0 commit comments

Comments
 (0)