← Complete problem index

PROJECT EULER · #0934

Unlucky Primes

Statement only · SolvedOriginal problem ↗

We define the unlucky prime of a number n, denoted u(n), as the smallest prime number p such that the remainder of n divided by p (i.e. nmodp) is not a multiple of seven.
For example, u(14)=3, u(147)=2 and u(1470)=13.

Let U(N) be the sum n=1Nu(n).
You are given U(1470)=4293.

Find U(1017).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.