Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-326-modulo-summations.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

985 B

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f4b21000cf542c50ffc5 5 Problem 326: Modulo Summations 301983

Description

Let an be a sequence recursively defined by: .

So the first 10 elements of an are: 1,1,0,3,0,3,5,4,1,9.

Let f(N,M) represent the number of pairs (p,q) such that:

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).

Instructions

Tests

tests:
  - text: <code>euler326()</code> should return 1966666166408794400.
    testString: assert.strictEqual(euler326(), 1966666166408794400);

Challenge Seed

function euler326() {
  // Good luck!
  return true;
}

euler326();

Solution

// solution required