2018-10-10 22:03:03 +00:00
|
|
|
---
|
|
|
|
id: 5900f4a21000cf542c50ffb5
|
2021-02-06 04:42:36 +00:00
|
|
|
title: 'Problem 310: Nim Square'
|
2018-10-10 22:03:03 +00:00
|
|
|
challengeType: 5
|
2021-02-06 04:42:36 +00:00
|
|
|
forumTopicId: 301966
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-310-nim-square
|
2018-10-10 22:03:03 +00:00
|
|
|
---
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --description--
|
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Alice and Bob play the game Nim Square.
|
2020-12-16 07:37:30 +00:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Nim Square is just like ordinary three-heap normal play Nim, but the players may only remove a square number of stones from a heap.
|
2020-12-16 07:37:30 +00:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
The number of stones in the three heaps is represented by the ordered triple (a,b,c).
|
2020-02-17 16:40:55 +00:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
If 0≤a≤b≤c≤29 then the number of losing positions for the next player is 1160.
|
2020-02-17 16:40:55 +00:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Find the number of losing positions for the next player if 0≤a≤b≤c≤100 000.
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
`euler310()` should return 2586528661783.
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
assert.strictEqual(euler310(), 2586528661783);
|
2018-10-10 22:03:03 +00:00
|
|
|
```
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler310() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler310();
|
|
|
|
```
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|