Skip to content

Instantly share code, notes, and snippets.

@53845714nF
Last active April 26, 2024 07:46
Show Gist options
  • Save 53845714nF/688c85068575f1d8fbec731e4ce469ad to your computer and use it in GitHub Desktop.
Save 53845714nF/688c85068575f1d8fbec731e4ce469ad to your computer and use it in GitHub Desktop.
The Ackermann function as Bash One-Liner
echo "define a(m,n){if(m==0){return(n+1)};if(m>0&&n==0){return (a(m-1,1))};if(m>0&&n>0){ return a(m-1,a(m,n-1))}}a(4,1)" | bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment