#include #include int countfactors (long long unsigned int x) { long long unsigned int i; int tf = 0; double m = sqrt(x); for (i=1;i<=m;i++) { if (x % i == 0) { tf+=2; if (i == m) tf--; } } return tf; } int main() { long long unsigned int i,nfactors,j,count=0; for (i = 2; i < 10000000; i++) { nfactors = countfactors(i); if (nfactors == j) count++; j = nfactors; if (i % 1000000 == 0) printf("On %llu\n",i); } printf("Total: %llu\n",count); }