2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f4b21000cf542c50ffc5
|
|
|
|
title: 'Problem 326: Modulo Summations'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 301983
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-326-modulo-summations
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
Let an be a sequence recursively defined by: .
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
So the first 10 elements of an are: 1,1,0,3,0,3,5,4,1,9.
|
|
|
|
|
2018-10-08 00:01:53 +00:00
|
|
|
Let f(N,M) represent the number of pairs (p,q) such that:
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
It can be seen that f(10,10)=4 with the pairs (3,3), (5,5), (7,9) and (9,10).
|
|
|
|
|
|
|
|
You are also given that f(104,103)=97158.
|
|
|
|
|
|
|
|
Find f(1012,106).
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
`euler326()` should return 1966666166408794400.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
|
|
|
assert.strictEqual(euler326(), 1966666166408794400);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
function euler326() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler326();
|
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|