Files
freeCodeCamp/curriculum/challenges/arabic/10-coding-interview-prep/project-euler/problem-282-the-ackermann-function.md
2022-10-20 09:13:17 -07:00

923 B

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4861000cf542c50ff99 Problem 282: The Ackermann function 1 301933 problem-282-the-ackermann-function

--description--

For non-negative integers m, n, the Ackermann function A(m, n) is defined as follows:

$$A(m, n) = \begin{cases} n + 1 & \text{if $m = 0$} \\ A(m - 1, 1) & \text{if m > 0 and $n = 0$} \\ A(m - 1, A(m, n - 1)) & \text{if m > 0 and $n > 0$} \end{cases}$$

For example A(1, 0) = 2, A(2, 2) = 7 and A(3, 4) = 125.

Find \displaystyle\sum_{n = 0}^6 A(n, n) and give your answer mod {14}^8.

--hints--

ackermanFunction() should return 1098988351.

assert.strictEqual(ackermanFunction(), 1098988351);

--seed--

--seed-contents--

function ackermanFunction() {

  return true;
}

ackermanFunction();

--solutions--

// solution required