Periodic representation for cubic irrationalities