← Complete problem index

PROJECT EULER · #0736

Paths to Equality

Statement only · UnsolvedOriginal problem ↗

Define two functions on lattice points:

r(x,y)=(x+1,2y)
s(x,y)=(2x,y+1)

A path to equality of length n for a pair (a,b) is a sequence ((a1,b1),(a2,b2),,(an,bn)), where:

  • (a1,b1)=(a,b)
  • (ak,bk)=r(ak1,bk1) or (ak,bk)=s(ak1,bk1) for k>1
  • akbk for k<n
  • an=bn

an=bn is called the final value.

For example,

(45,90)r(46,180)s(92,181)s(184,182)s(368,183)s(736,184)r
(737,368)s(1474,369)r(1475,738)r(1476,1476)

This is a path to equality for (45,90) and is of length 10 with final value 1476. There is no path to equality of (45,90) with smaller length.

Find the unique path to equality for (45,90) with smallest odd length. Enter the final value as your answer.

Write-up coming later

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