Python Program Number Pattern Rules