chore(i18n,learn): processed translations (#45151)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5a23c84252665b21eecc7eca
|
||||
title: Kaprekar numbers
|
||||
title: Numeri di Kaprekar
|
||||
challengeType: 5
|
||||
forumTopicId: 302296
|
||||
dashedName: kaprekar-numbers
|
||||
@ -8,77 +8,77 @@ dashedName: kaprekar-numbers
|
||||
|
||||
# --description--
|
||||
|
||||
A positive integer is a [Kaprekar number](https://en.wikipedia.org/wiki/Kaprekar number) if:
|
||||
Un numero intero positivo è un [numero di Kaprekar](https://en.wikipedia.org/wiki/Kaprekar number) se:
|
||||
|
||||
<ul>
|
||||
<li>It is 1, or,</li>
|
||||
<li>The decimal representation of its square may be split once into two parts consisting of positive integers which sum to the original number. </li>
|
||||
<li>È 1 o,</li>
|
||||
<li>La rappresentazione decimale del suo quadrato può essere suddivisa una volta in due parti costituite da interi positivi che sommano al numero originale. </li>
|
||||
</ul>
|
||||
|
||||
Note that a split resulting in a part consisting purely of 0s is not valid, as 0 is not considered positive.Example
|
||||
Si noti che una scissione risultante in una parte costituita esclusivamente da 0 non è valida, in quanto 0 non è considerato positivo.
|
||||
|
||||
Kaprekar numbers:
|
||||
Esempi di numeri di Kaprekar:
|
||||
|
||||
<ul>
|
||||
<li><code>2223</code> is a Kaprekar number, as <code>2223 * 2223 = 4941729</code>, <code>4941729</code> may be split to <code>494</code> and <code>1729</code>, and <code>494 + 1729 = 2223</code></li>
|
||||
<li>The series of Kaprekar numbers is known as <a href='https://oeis.org/A006886' target='_blank'>A006886</a>, and begins as <code>1, 9, 45, 55, ...</code></li>
|
||||
<li><code>2223</code> è un numero Kaprekar, poiché <code>2223 * 2223 = 4941729</code>, <code>4941729</code> può essere suddiviso in <code>494</code> e <code>1729</code>and <code>494 + 1729 = 2223</code></li>
|
||||
<li>La serie di numeri Kaprekar è conosciuta come <a href='https://oeis.org/A006886' target='_blank'>A006886</a> e inizia con <code>1, 9, 45, 55, ...</code></li>
|
||||
</ul>
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a function that takes a number $n$, a base $bs$, and returns true if the number is a Kaprekar number for the given base. Otherwise, the function returns false.
|
||||
Scrivi una funzione che prende un numero $n$, una base $bs$, e restituisce vero se il numero è un numero di Kaprekar per la base specificata. Altrimenti, la funzione restituisce falso.
|
||||
|
||||
# --hints--
|
||||
|
||||
`isKaprekar` should be a function.
|
||||
`isKaprekar` dovrebbe essere una funzione.
|
||||
|
||||
```js
|
||||
assert(typeof isKaprekar == 'function');
|
||||
```
|
||||
|
||||
`isKaprekar(1, 10)` should return a boolean.
|
||||
`isKaprekar(1, 10)` dovrebbe restituire un booleano.
|
||||
|
||||
```js
|
||||
assert(typeof isKaprekar(1, 10) == 'boolean');
|
||||
```
|
||||
|
||||
`isKaprekar(1, 10)` should return `true`.
|
||||
`isKaprekar(1, 10)` dovrebbe restituire `true`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(1, 10), true);
|
||||
```
|
||||
|
||||
`isKaprekar(9, 10)` should return `true`.
|
||||
`isKaprekar(9, 10)` dovrebbe restituire `true`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(9, 10), true);
|
||||
```
|
||||
|
||||
`isKaprekar(2223, 10)` should return `true`.
|
||||
`isKaprekar(2223, 10)` dovrebbe restituire `true`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(2223, 10), true);
|
||||
```
|
||||
|
||||
`isKaprekar(22823, 10)` should return `false`.
|
||||
`isKaprekar(22823, 10)` dovrebbe restituire `false`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(22823, 10), false);
|
||||
```
|
||||
|
||||
`isKaprekar(9, 17)` should return `false`.
|
||||
`isKaprekar(9, 17)` dovrebbe restituire `false`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(9, 17), false);
|
||||
```
|
||||
|
||||
`isKaprekar(225, 17)` should return `true`.
|
||||
`isKaprekar(225, 17)` dovrebbe restituire `true`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(225, 17), true);
|
||||
```
|
||||
|
||||
`isKaprekar(999, 17)` should return `false`.
|
||||
`isKaprekar(999, 17)` dovrebbe restituire `false`.
|
||||
|
||||
```js
|
||||
assert.equal(isKaprekar(999, 17), false);
|
||||
|
Reference in New Issue
Block a user