← Complete problem index

PROJECT EULER · #0955

Finding Triangles

Statement only · SolvedOriginal problem ↗

A sequence (an)n0 starts with a0=3 and for each n0,

  • if an is a triangle numberA triangle number is a number of the form m(m+1)/2 for some integer m., then an+1=an+1;
  • otherwise, an+1=2anan1+1.

The sequence begins: 3,4,6,7,9,12,16,21,22,24,27,31,36,37,39,42, where triangle numbers are marked red.

The 10th triangle number in the sequence is a2964=1439056.
Find the index n such that an is the 70th triangle number in the sequence.

Write-up coming later

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