Add & b <= 5000000 to the first if. ----- Yasir Kaheil -- View this message in context: http://r.789695.n4.nabble.com/R-Function-with-two-inputs-telling-whether-the-sum-is-a-cube-number-tp4718688p4718689.html Sent from the datatable-help mailing list archive at Nabble.com.