Maximizing a Strange Function

Define a function f ( n ) f(n) for some positive, integral n n as the number of positive integral a < n a<n for which the expression

n a a \dfrac{n-a}{a}

is also a positive integer. What is the maximum value of f ( n ) f(n) for n 1000 n \leq 1000 ?


The answer is 31.

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.

3 solutions

Daniel Liu
May 15, 2014

Note that if n a a \dfrac{n-a}{a} is a positive integer, so is n a \dfrac{n}{a} . Thus, we want to find the number n 1000 n\le 1000 such that it has the largest possible number of prime factors. Checking the list of Highly Composite numbers , we see that this number is 840 840 with 32 32 factors. Every single one of these factors can work for a a except 840 840 since a < n a < n . Thus, the answer is 31 \boxed{31} .

Finn Hulse
May 15, 2014

The key is to use the Euclidean Algorithm . In short, if a number n n is divisible by a a , the expression will be an integer. For example, for n = 20 n=20 , a a can equal 5 5 , 10 10 , 4 4 , 2 2 , or 1 1 . Convince yourself that this is true. Do you see why?

Anyways, this can be applied to the problem by realizing that we're really just looking for the number 1000 \leq 1000 with the most factors. You're welcome to use any means, but you could just know that this is 840 840 off the top of your head.

Now, you may be tempted to realize 840 840 has 32 32 factors and just put 32 32 as your final answer, but read this line:

\dots positive integral a < n a<n \dots

Because we're overcounting by 1 1 since we obviously can't count 840 840 , our final answer is 32 1 = 31 32-1=\boxed{31} .

oops, I just got sniped :P

Daniel Liu - 7 years ago

Also, finding that 840 840 is the number you want is no trivial task. I challenge you to find a solution to why it is 840 840 :)

Daniel Liu - 7 years ago

Log in to reply

Actually, I challenge you to find a solution to why it is 840 840 . Sniped. :D

Finn Hulse - 7 years ago

Sage Code:

1
2
3
4
5
6
7
    def f(n):c = 0for a in xrange(1,n+1):if (n-a)/a > 0:if (n-a)/a in ZZ:c += 1return c

Next run:

1
2
3
4
5
6
    l = []n = 1while n < 1000:l.append(f(n))n += 1
   max(l)

It returns 31 31

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...