yaworsw/euler-manager

View on GitHub
data/problems/411.yml

Summary

Maintainability
Test Coverage
---
:id: 411
:name: Uphill paths
:url: https://projecteuler.net/problem=411
:content: "Let <var>n</var> be a positive integer. Suppose there are stations at the
  coordinates (<var>x</var>, <var>y</var>) = (2<sup><var>i</var></sup> mod <var>n</var>,
  3<sup><var>i</var></sup> mod <var>n</var>) for 0 ≤ <var>i</var> ≤ 2<var>n</var>.
  We will consider stations with the same coordinates as the same station.\n\nWe wish
  to form a path from (0, 0) to (<var>n</var>, <var>n</var>) such that the x and y
  coordinates never decrease.  \nLet S(<var>n</var>) be the maximum number of stations
  such a path can pass through.\n\nFor example, if <var>n</var> = 22, there are 11
  distinct stations, and a valid path can pass through at most 5 stations. Therefore,
  S(22) = 5. The case is illustrated below, with an example of an optimal path:\n\n![p411_longpath.png]({{
  images_dir }}/p411_longpath.png)\n\nIt can also be verified that S(123) = 14 and
  S(10000) = 48.\n\nFind ∑ S(<var>k</var><sup>5</sup>) for 1 ≤ <var>k</var> ≤ 30.\n\n"