For a tridiagonal matrix with a fixed pattern, let D(k) be its k-by-k determinant and compute the sum of gcd(D(i), D(N)) for i from 1 to N, modulo 1e9+7.
Hard8MathNumber theoryDynamic programmingCombinatoricsNo attempts yetTime limit2sMemory limit512 MB