You are on page 1of 1

/*

* 47 - Distinct Primes Factors.cpp


*
* Author: tempo
*/
#include <iostream>

const int n = 500000;

int main(){
int factorCount[n];

for (int i = 0; i < n; i++)


factorCount[i] = 0;

for (int i = 2; i < n; i++)


if (factorCount[i] == 0)
for (int j = i; j < n; j += i)
factorCount[j]++;

for (int i = 10; i < n-4; i++)


if (factorCount[i] == 4 && factorCount[i-1] == 4 && factorCount[i-2] ==
4 && factorCount[i-3] == 4){
std::cout << i-3 << std::endl;
break;
}
}

You might also like