2021-06-15 00:49:18 -07:00
|
|
|
---
|
|
|
|
id: 5900f4861000cf542c50ff99
|
2022-03-01 21:39:26 +05:30
|
|
|
title: 'Problema 282: La funzione Ackermann'
|
2021-06-15 00:49:18 -07:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 301933
|
|
|
|
dashedName: problem-282-the-ackermann-function
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-03-01 21:39:26 +05:30
|
|
|
Per gli interi non negativi $m$, $n$, la funzione Ackermann $A(m, n)$ è definita come segue:
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-03-31 22:31:59 +05:30
|
|
|
$$A(m, n) = \begin{cases} n + 1 & \text{if $m = 0$} \\\\
|
|
|
|
A(m - 1, 1) & \text{if $m > 0$ e $n = 0$} \\\\ A(m - 1, A(m, n - 1)) & \text{if $m > 0$ e $n > 0$} \end{cases}$$
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-03-01 21:39:26 +05:30
|
|
|
Per esempio $A(1, 0) = 2$, $A(2, 2) = 7$ e $A(3, 4) = 125$.
|
|
|
|
|
|
|
|
Trova $\displaystyle\sum_{n = 0}^6 A(n, n)$ e dai la tua risposta mod ${14}^8$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-03-01 21:39:26 +05:30
|
|
|
`ackermanFunction()` dovrebbe restituire `1098988351`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
```js
|
2022-03-01 21:39:26 +05:30
|
|
|
assert.strictEqual(ackermanFunction(), 1098988351);
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
2022-03-01 21:39:26 +05:30
|
|
|
function ackermanFunction() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-03-01 21:39:26 +05:30
|
|
|
ackermanFunction();
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|