Algorithmic Ways for Mathematical Puzzles