Pyrgic Puzzles n-digit solver

This program solves the type of puzzle usually given as one of the Pyrgic Puzzles by Chris Maslanka at the back of Guardian Weekend. They are of the form:

A certain 14-digit number consists of two 7s separated by 7 digits, two 6s separated by 6 digits, two 5s separated by 5 digits and so on, all the way down to a pair of 1s with a single digit between. Two of the digits have already been placed for you.

. 1 . . . . . . . . . . 2 .

What is the number?

So enter the given string here, with any other character for missing number, and hopefully see it solved; it’s much more satisfying to do it yourself, though. :)