A260002 Sudan Numbers: a(n)= f(n,n,n) where f is the Sudan function.
0, 3, 15569256417
Offset: 0
Examples
a(1) = f(1,1,1) = f(0, f(1,1,0), f(1,1,0)+1) = f(0, 1, 2) = 1+2 = 3.
Links
- Wikipedia, Sudan Function, Primitive Recursive, Ackermann function.
Programs
-
Mathematica
f[z_, x_, y_] := f[z, x, y] = Piecewise[{{x + y, z == 0}, {x, z > 0 && y == 0}, {f[z - 1, f[z, x, y - 1], f[z, x, y - 1] + y], z > 0 && y > 0} }]; a[n_] := f[n,n,n]
-
PARI
f(z,x,y)=if(z,if(y,my(t=f(z,x,y-1)); f(z-1, t, t+y),x),x+y) a(n)=f(n,n,n) \\ Charles R Greathouse IV, Jul 28 2015
Comments