Hacker News new | ask | show | jobs
by neolefty 5232 days ago
Isn't it 6 million squared? 36 x 10^12. Factorial would be the number of ordered sets that include all the elements.
1 comments

At the risk of redundancy (I wrote my post while you posted): you're double counting (since gcd(a,b) = gcd(b,a), you needn't compute both; either tells you whether a,b have a common factor. (a,b) and (b,a) having a common factor both account for the same problem) and you're including pairs of the same element (gcd(a,a)=a always, but this is meaningless for the data set we're considering--we don't care that a number has common factors with itself, only with other numbers)