2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f4861000cf542c50ff99
|
|
|
|
title: 'Problem 282: The Ackermann function'
|
2020-11-27 19:02:05 +01:00
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 301933
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: problem-282-the-ackermann-function
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-22 05:38:46 +02:00
|
|
|
For non-negative integers $m$, $n$, the Ackermann function $A(m, n)$ is defined as follows:
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-22 05:38:46 +02:00
|
|
|
$$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}$$
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-22 05:38:46 +02:00
|
|
|
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$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --hints--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-22 05:38:46 +02:00
|
|
|
`ackermanFunction()` should return `1098988351`.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```js
|
2021-07-22 05:38:46 +02:00
|
|
|
assert.strictEqual(ackermanFunction(), 1098988351);
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --seed--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --seed-contents--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
2021-07-22 05:38:46 +02:00
|
|
|
function ackermanFunction() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-22 05:38:46 +02:00
|
|
|
ackermanFunction();
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|