freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-134-prime-pair-connection.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.2 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f3f21000cf542c50ff05 5 false Problem 134: Prime pair connection 301762

Description

Consider the consecutive primes p1 = 19 and p2 = 23. It can be verified that 1219 is the smallest number such that the last digits are formed by p1 whilst also being divisible by p2. In fact, with the exception of p1 = 3 and p2 = 5, for every pair of consecutive primes, p2 > p1, there exist values of n for which the last digits are formed by p1 and n is divisible by p2. Let S be the smallest of these values of n. Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000.

Instructions

Tests

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

Challenge Seed

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

euler134();

Solution

// solution required