Skip to content

Instantly share code, notes, and snippets.

@fmap
Last active January 2, 2016 21:09
Show Gist options
  • Save fmap/8361811 to your computer and use it in GitHub Desktop.
Save fmap/8361811 to your computer and use it in GitHub Desktop.
a (m,n) | m==0 = n+1
| m>0 && n==0 = a(m-1,1)
| m>0 && n>0 = a(m-1,a(m,n-1))
k c n d | n == 0 = c*d
| n == 1 = c^d
| d == 0 = 1
| otherwise = k c (n-1) $ k c n (d-1)
g = (!!63) $ iterate (\ n -> k 3 n 3) 4
main = return (a(g,g))
>>= putStrLn . show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment