---
id: 5900f4c21000cf542c50ffd4
challengeType: 5
title: 'Problem 340: Crazy Function'
videoUrl: ''
localeTitle: 'Problema 340: Função Maluca'
---

## Description
<section id="description"> Para inteiros fixos a, b, c, defina a função maluca F (n) da seguinte maneira: F (n) = n - c para todo n&gt; b F (n) = F (a + F (a + F) F (a + n)))) para todo n ≤ b. <p> Além disso, defina S (a, b, c) =. </p><p> Por exemplo, se a = 50, b = 2000 e c = 40, então F (0) = 3240 e F (2000) = 2040. Também, S (50, 2000, 40) = 5204240. </p><p> Encontre os últimos 9 dígitos de S (217, 721, 127). </p></section>

## Instructions
<section id="instructions">
</section>

## Tests
<section id='tests'>

```yml
tests:
  - text: <code>euler340()</code> deve retornar 291504964.
    testString: 'assert.strictEqual(euler340(), 291504964, "<code>euler340()</code> should return 291504964.");'

```

</section>

## Challenge Seed
<section id='challengeSeed'>

<div id='js-seed'>

```js
function euler340() {
  // Good luck!
  return true;
}

euler340();

```

</div>



</section>

## Solution
<section id='solution'>

```js
// solution required
```
</section>
