CalcuDoku is a mathematical and logical puzzle loosely similar to sudoku. It was invented by a Japanese mathematics teacher Tetsuya Miyamoto. The objective is to fill the grid in with the digits 1 through N (where N is the number of rows or columns in the grid) such that: