I am unsure why the answer is 8 instead of 16. This is from one of the exercises under the Swift Prep on the topic “Niffy Factor-Finding System”
My working is as per the screen shot below along with Greg’s solution. Essentially the factors I have identified are 1, 2, 4, 5, 10, 20, 25, 50. Therefore, total factors for number 40 → 8 x 2 = 16. Instead, Greg’s solution is 8? Looking forward to some help here. Thanks.
To find the factors we first do prime factorization, so for 40 its 2^3 and 5
To find the factors, only positive, we add 1 to the exponent of the prime factor and multiply all the numbers…i.e. 4*2=8
Thanks for the reply. Seems like you didn’t account for the negative factors? Otherwise, I have also arrived at 8 factors for 40. Don’t we have to account for the negative factors as well?
Silly me… I just realised the question is asking only for positive factors. Need to read question properly. Haha many thanks for helping me to discover that.
1 Like