--- title: Iterated digits squaring id: 5a23c84252665b21eecc7ec1 challengeType: 5 videoUrl: '' localeTitle: Dígitos iterados em quadratura --- ## Description
Se você adicionar o quadrado dos dígitos de um número Natural (um número inteiro maior que zero), você sempre terminará com 1 ou 89:
 15 -> 26 -> 40 -> 16 -> 37 -> 58 -> 89
7 -> 49 -> 97 -> 130 -> 10 -> 1 
Escreva uma função que use um número como parâmetro e retorne 1 ou 89 depois de executar o processo mencionado.
## Instructions
## Tests
```yml tests: - text: iteratedSquare deve ser uma função. testString: 'assert(typeof iteratedSquare=="function","iteratedSquare should be a function.");' - text: iteratedSquare(4) deve retornar um número. testString: 'assert(typeof iteratedSquare(4)=="number","iteratedSquare(4) should return a number.");' - text: iteratedSquare(4) deve retornar 89 . testString: 'assert.equal(iteratedSquare(4),89,"iteratedSquare(4) should return 89.");' - text: iteratedSquare(7) deve retornar 1 . testString: 'assert.equal(iteratedSquare(7),1,"iteratedSquare(7) should return 1.");' - text: iteratedSquare(15) deve retornar 89 . testString: 'assert.equal(iteratedSquare(15),89,"iteratedSquare(15) should return 89.");' - text: iteratedSquare(20) deve retornar 89 . testString: 'assert.equal(iteratedSquare(20),89,"iteratedSquare(20) should return 89.");' - text: iteratedSquare(70) deve retornar 1 . testString: 'assert.equal(iteratedSquare(70),1,"iteratedSquare(70) should return 1.");' - text: iteratedSquare(100) deve retornar 1 . testString: 'assert.equal(iteratedSquare(100),1,"iteratedSquare(100) should return 1.");' ```
## Challenge Seed
```js function iteratedSquare (n) { // Good luck! } ```
## Solution
```js // solution required ```