Funny Numbers!

A positive integer n n is funny if for each of its positive divisors d d , the number d + 2 d+2 is prime . Find the sum of all funny numbers that have the most quantity of divisors .


The answer is 135.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Ivan Koswara
Apr 5, 2016

We have several observations:

  • If n n is even, then it is not funny, since 2 is a divisor of n n but 2 + 2 = 4 2+2 = 4 is not prime.
  • If n n has a prime divisor in the form 3 k + 1 3k+1 , then it is not funny, since ( 3 k + 1 ) + 2 = 3 k + 3 (3k+1) + 2 = 3k+3 is not prime.
  • If n n has two prime divisors (counting multiplicity) in the form 3 p + 2 , 3 q + 2 3p+2, 3q+2 , then it is not funny, since ( 3 p + 2 ) ( 3 q + 2 ) (3p+2)(3q+2) divides n n and ( 3 p + 2 ) ( 3 q + 2 ) + 2 = 9 p q + 6 p + 6 q + 6 (3p+2)(3q+2) + 2 = 9pq + 6p + 6q + 6 is a multiple of 3, hence not prime.

Thus either n = 3 a n = 3^a or n = 3 a ( 3 p + 2 ) n = 3^a (3p+2) , where a a is a nonnegative number and 3 p + 2 3p+2 is prime. (If not, then n n has more than one prime divisors that aren't 3; either some of them are 3 k + 1 3k+1 , or all of them are 3 k + 2 3k+2 and hence there are at least two of them.)

Observe that n = 135 = 3 3 5 n = 135 = 3^3 \cdot 5 satisfies this condition, with 8 positive divisors. Also observe that 3 5 + 2 = 245 3^5 + 2 = 245 is not prime (multiple of 5), so a 4 a \le 4 . Thus n = 3 a n = 3^a is impossible since it only has a + 1 < 8 a+1 < 8 positive divisors.

Now, n = 3 a ( 3 p + 2 ) n = 3^a (3p+2) has 2 ( a + 1 ) 2(a+1) positive divisors, so we need a 3 a \ge 3 . Thus 3 p + 2 , 3 ( 3 p + 2 ) , 9 ( 3 p + 2 ) , 27 ( 3 p + 2 ) 3p+2, 3(3p+2), 9(3p+2), 27(3p+2) are all divisors of n n . Note that they are congruent to 3 p + 2 , 2 ( 3 p + 2 ) , 3 ( 3 p + 2 ) , 4 ( 3 p + 2 ) 3p+2, 2(3p+2), 3(3p+2), 4(3p+2) modulo 5. If 3 p + 2 5 3p+2 \neq 5 , then 3 p + 2 3p+2 is not divisible by 5, and thus these four form an almost complete congruence classes modulo 5 (they are 1, 2, 3, 4 modulo 5 in some order). Suppose 3 b ( 3 p + 2 ) 3 ( m o d 5 ) 3^b(3p+2) \equiv 3 \pmod 5 . Then 3 b ( 3 p + 2 ) + 2 0 ( m o d 5 ) 3^b(3p+2) + 2 \equiv 0 \pmod 5 , and clearly since 3 p + 2 5 3p+2 \ge 5 , 3 b ( 3 p + 2 ) + 2 5 3^b(3p+2) + 2 \neq 5 . Thus it is divisible by 5 and hence not prime.

Thus the assumption 3 p + 2 5 3p+2 \neq 5 is false, so 3 p + 2 = 5 3p+2 = 5 . It can be verified that 3 4 5 + 2 = 407 3^4 \cdot 5 + 2 = 407 is not prime (multiple of 11), so the n n with the most positive divisors is 3 3 5 = 135 3^3 \cdot 5 = 135 .

Good! Simple and well explained solution.

Mateo Matijasevick - 5 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...