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. _______________________________________________ datatable-help mailing list datatable-help@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help