aboutsummaryrefslogtreecommitdiff
path: root/perfect.h
blob: 9f1fa0e71c8bac01852511301ab5f4cd2a623182 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// very helpful math functions

// Determines whether an int is a perfect number. 
// Don't use on perfect numbers over 33550335
int is_perfect(int i) { 
  if (i == 6 || i == 28 || i == 496 || i == 8128) { 
    return 1;
  } 
  return 0;
}

int is_even_prime(int i) {
  return i == 2;
}