--- id: 5900f3901000cf542c50fea3 challengeType: 5 title: 'Problem 36: Double-base palindromes' videoUrl: '' localeTitle: 问题36:双基回文 --- ## Description
十进制数,585 = 10010010012(二进制),在两个碱基中都是回文。找到所有数字的总和,小于n,而1000 <= n <= 1000000,它们在基数10和基数2中是回文的。(请注意,任一基数中的回文数可能不包括前导零。)
## Instructions
## Tests
```yml tests: - text: doubleBasePalindromes(1000)应该返回1772。 testString: 'assert(doubleBasePalindromes(1000) == 1772, "doubleBasePalindromes(1000) should return 1772.");' - text: doubleBasePalindromes(50000)应该返回105795。 testString: 'assert(doubleBasePalindromes(50000) == 105795, "doubleBasePalindromes(50000) should return 105795.");' - text: doubleBasePalindromes(500000)应该返回286602。 testString: 'assert(doubleBasePalindromes(500000) == 286602, "doubleBasePalindromes(500000) should return 286602.");' - text: doubleBasePalindromes(1000000)应该返回872187。 testString: 'assert(doubleBasePalindromes(1000000) == 872187, "doubleBasePalindromes(1000000) should return 872187.");' ```
## Challenge Seed
```js function doubleBasePalindromes(n) { // Good luck! return n; } doubleBasePalindromes(1000000); ```
## Solution
```js // solution required ```