Exemplo n.º 1
0
int classify(int n)
{
    if (countDivisors(n) < n) {
        return -1;
    } else if (countDivisors(n) == n) {
        return 0;
    } else if (countDivisors(n) > n) {
        return 1;
    } else {
        return 5;
    }
}
Exemplo n.º 2
0
int main()
{
	unsigned long long Un = 1, n = 1; //Je sais pas trop à quoi m'attendre, donc je mets le max
	while(countDivisors(Un) < 500) //On cherche un nombre avec plus de 500 diviseurs
	{
		n++;
		Un += n; //Un = U(n-1) + n
		printf("U_%lld = %lld\n", n, Un);
	}

	return 0;
}
Exemplo n.º 3
0
int main()
{
    int * primeNumbers = loadPrimeNumbers();
    int64_t number = 1;
    int64_t increment = 2;
    int count = 0;
    while((count = countDivisors(number,primeNumbers))<=500)
        {
            number+=increment++;
        }
    printf("result: %"PRId64,number);
    return 0;
}