Skip to content

Instantly share code, notes, and snippets.

@scastiel
Created July 18, 2016 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scastiel/9564de4efc39e1b380dd99107cb3f938 to your computer and use it in GitHub Desktop.
Save scastiel/9564de4efc39e1b380dd99107cb3f938 to your computer and use it in GitHub Desktop.
function A(n) {
if (n === 0) {
return [ 841, 1189 ];
} else {
var dimAn1 = A(n - 1);
return [Math.floor(dimAn1[1] / 2), Math.floor(dimAn1[0])];
}
}
window.A = A;
[0, 1, 2, 3, 4].forEach(n => console.log(`A${n}:`, A(n)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment