This is just the canonical Ackermann function, implemented in Java
Reference: Wikipedia: Ackermann Function
- JRE 8
- Maven 3.6
$ ./start.sh
ack(0, 0) is 1
ack(0, 1) is 2
ack(0, 2) is 3
ack(0, 3) is 4
ack(0, 4) is 5
ack(0, 5) is 6
ack(0, 6) is 7
ack(0, 7) is 8
ack(0, 8) is 9
ack(0, 9) is 10
ack(1, 0) is 2
ack(1, 1) is 3
ack(1, 2) is 4
ack(1, 3) is 5
ack(1, 4) is 6
ack(1, 5) is 7
ack(1, 6) is 8
ack(1, 7) is 9
ack(1, 8) is 10
ack(1, 9) is 11
ack(2, 0) is 3
ack(2, 1) is 5
ack(2, 2) is 7
ack(2, 3) is 9
ack(2, 4) is 11
ack(2, 5) is 13
ack(2, 6) is 15
ack(2, 7) is 17
ack(2, 8) is 19
ack(2, 9) is 21
ack(3, 0) is 5
ack(3, 1) is 13
ack(3, 2) is 29
ack(3, 3) is 61
ack(3, 4) is 125
ack(3, 5) is 253
ack(3, 6) is 509
ack(3, 7) is 1021
ack(3, 8) is 2045
ack(3, 9) is 4093
ack(4, 0) is 13
ack(4, 1) is 65533