All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Take Factorial Ratios, Get Minimum (Posted on 2023-05-17) Difficulty: 3 of 5
Determine the minimum value of a nonnegative integer N, such that:
            (20N)!
            ------
            (N!)21
is NOT an integer.

Provide valid reasoning to support your answer.

Note: Computer program or spreadsheet assisted methodologies are welcome, but an analytical solution is preferred.

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution I think this is it. | Comment 1 of 3
It might be 23.

If you convert the numerator to a list of the prime factors of each factor, there will be 20 factors of 23.  Since 20 < 23, there are no 23^2 terms.
The same conversion to the denominator will have 21 factors of 23.

There is one more factor of 23 in the denominator than the numerator.  Therefore, the quotient is not an integer.

I used the following code to gain insight, 23 was the smallest number that "failed".

----------
def isprime(n):
    '''check if integer n is a prime'''
    n = abs(int(n))
    if n < 2:
        return False
    if n == 2: 
        return True    
    if not n & 1: 
        return False
    for x in range(3, int(n**0.5)+1, 2):
        if n % x == 0:
            return False
    return True

def prime_factor(n): 
    """  for integer n, return a list of all the prime factors """
    top = n // 2
    factors = []
    
    for i in range(2,top+1):
        while n/i % 1 == 0:
            factors.append(int(i))
            n = n/i
            if n == 1:
                return factors
    if n != 1:
        factors.append(int(n))
    return factors

def test(n):
    top = [i for i in range(1,20*n+1)]
    bot = sorted([i for i in range(1,n+1)]*21)
    t = []
    b = []
    for n in top:
        t = t + (prime_factor(n))
    for n in bot:
        b = b + (prime_factor(n))
    t = sorted(t)
    b = sorted(b)
    primes = [i for i in range(20*n+1) if isprime(i)]
    result = True
    for p in primes:
        countTop = t.count(p)
        countBot = b.count(p)
        if (countTop < countBot):
            result = False
            print(p, countTop, countBot)
            
    return result

  Posted by Larry on 2023-05-17 08:30:25
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information