TEHRAN — Iran’s leaders, seizing on perceived flexibility in a private letter from President Obama, have decided to gamble on forging a swift agreement over their nuclear program with the goal of ending crippling sanctions, a prominent adviser to the Iranian leadership said Thursday.