I am looking for a formula to use in an IF statement to determine if a given number is the product of a number 2 or greater multiplied by a number 3 or greater.
For instance, 6 is the smallest number that meets the requirement (2 x 3). 7 doesn’t, 8 does (2 x 4), 9 does (3 x 3), 10 does (2 x 5), 11 doesn’t, 12 does (2 x 6), etc.
Any ideas?
Thanks!
Sounds like you’re doing primality testing. You should check out that Wikipedia article – they’ve got several algorithms to pick from.
Hope that helps!