Ackermann's function (ANSI C syntax) :
unsigned int Ack(unsigned int x, unsigned int y){return (x>0)?Ack(x-1,(y>0)?Ack(x,y-1):1):y+1;}
x \ y012345678910111213formula for y>0
01234567891011121314y+1
123456789101112131415y+2
23579111315171921232527292y+3
3513296112525350910212045409381891638132765655332y+3-3
41365533¡¿¡¿¡¿    2Ack(4,y-1)+3-3
565533    ?!?!?!Ack(4,Ack(5,y-1))
Click any cell to compute Ackermann's function with JavaScript.
If you get a stack overflow, you may need to refresh the frame.
This shows that a simple recursive function can grow very fast.
Some cells were left empty to preserve the network bandwidth.
Most browsers fail to compute Ack(3,7) and greater or crash.

«Home»PortuguêsEnglishFrançaisValid HTML 3.2!Modif. 1998-08-19