Van Eck-like Sequence: N-th Term

Asked at Bloomberg · Coding & Leetcode-style Questions · Difficulty: Medium

Given an integer `n` (`n >= 1`), define an integer sequence `a` as follows:

Loading the problem…