2021-06-15 00:49:18 -07:00
|
|
|
---
|
|
|
|
id: 5900f53c1000cf542c51004e
|
2021-11-29 08:32:04 -08:00
|
|
|
title: 'Problema 463: Uma relação de recorrência estranha'
|
2021-06-15 00:49:18 -07:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 302138
|
|
|
|
dashedName: problem-463-a-weird-recurrence-relation
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
A função $f$ é definida para todos os números inteiros positivos da seguinte forma:
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-04-05 23:36:59 +05:30
|
|
|
$$\begin{align} & f(1) = 1 \\\\
|
|
|
|
& f(3) = 3 \\\\ & f(2n) = f(n) \\\\
|
|
|
|
& f(4n + 1) = 2f(2n + 1) - f(n) \\\\ & f(4n + 3) = 3f(2n + 1) - 2f(n) \end{align}$$
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
A função $S(n)$ é definida como $\sum_{i=1}^{n} f(i)$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
$S(8) = 22$ e $S(100) = 3604$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
Encontre $S(3^{37})$. Dê os últimos 9 algarismos da sua resposta.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
`weirdRecurrenceRelation()` deve retornar `808981553`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
```js
|
2021-11-29 08:32:04 -08:00
|
|
|
assert.strictEqual(weirdRecurrenceRelation(), 808981553);
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
2021-11-29 08:32:04 -08:00
|
|
|
function weirdRecurrenceRelation() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-11-29 08:32:04 -08:00
|
|
|
weirdRecurrenceRelation();
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|