Problem: if p is a prime number greater than 3 , find the remainder when p ^ 2 + 16 is divided by 12 .
Rationale: every prime number greater than 3 can be written 6 n + 1 or 6 n - 1 . if p = 6 n + 1 , then p ^ 2 + 16 = 36 n ^ 2 + 12 n + 1 + 16 = 36 n ^ 2 + 12 n + 12 + 5 if p = 6 n - 1 , then p ^ 2 + 16 = 36 n ^ 2 - 12 n + 1 + 16 = 36 n ^ 2 - 12 n + 12 + 5 when divided by 12 , it must leave a remainder of 5 . the answer is a .
annotated_formula: subtract(add(16, power(add(const_1, const_4), const_2)), multiply(12, 3))