Project Euler Problem 569

A mountain range consists of a line of mountains with slopes of exactly 45^circ, and heights governed by the prime numbe

Project Euler Problem 569

Solution

Answer: 21025060

Using the visibility-chain algorithm described above, the computation satisfies the checks from the problem statement:

  • $P(3)=1$
  • $P(9)=3$
  • $\sum_{k=1}^{100} P(k)=227$

Running the full computation for $2{,}500{,}000$ peaks gives:

Answer: 21025060