26 lines
709 B
Markdown
26 lines
709 B
Markdown
---
|
||
id: 5900f4041000cf542c50ff17
|
||
title: 问题152:将一半写为倒数平方和
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
---
|
||
|
||
# --description--
|
||
|
||
有几种方法可以使用不同的整数将数字1/2写成反平方和。
|
||
|
||
例如,可以使用数字{2,3,4,5,7,12,15,20,28,35}:
|
||
|
||
实际上,仅使用2到45之间的整数(包括2和45),完全可以通过三种方式来实现,其余两种方式是:{2,3,4,6,7,9,10,20,28,35,36,45 }和{2,3,4,6,7,9,12,15,28,30,35,36,45}。 使用2到80之间(含2和80)的不同整数,有多少种方法可以将数字1/2写成反平方和?
|
||
|
||
# --hints--
|
||
|
||
<code>euler152()</ code>应该返回301。
|
||
|
||
```js
|
||
assert.strictEqual(euler152(), 301);
|
||
```
|
||
|
||
# --solutions--
|
||
|