Thirty nines!

What is the least positive integer n n that can be placed in the following expression:

n ! ( n + 1 ) ! ( 2 n + 1 ) ! 1 \large \color{#D61F06} n! (n+1)! (2n+1)! -1

and yields a number ending with thirty digits of 9's.

Notation: ! is a factorial notation; for example, 8 ! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 8! = 8\times7\times6\times5\times4\times 3\times2\times1

43 53 34 33 35

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.

2 solutions

Zico Quintina
May 2, 2018

If the expression n ! ( n + 1 ) ! ( 2 n + 1 ) ! 1 n!(n+1)!(2n+1)!-1 is to end in a string of thirty 9's, we need N = n ! ( n + 1 ) ! ( 2 n + 1 ) ! N=n!(n+1)!(2n+1)! to end in thirty zero's, i.e. to be a multiple of 1 0 30 10^{30} . This will happen if the three factors of N N collectively contain at least thirty 2's and thirty 5's in their prime factorizations.

For p p a prime, the prime factorization of n ! n! will contain at least one p p for every multiple of p p in its expansion, so for n 2 n \ge 2 , n ! = 1 2 3 4 5 6 7 n n! \color{#333333} = 1 \cdot \color{#20A900}2 \color{#333333} \cdot 3 \cdot \color{#20A900}{4} \color{#333333} \cdot \color{#D61F06}5 \color{#333333} \cdot \color{#20A900}{6} \color{#333333} \cdot 7 \cdot \ldots \cdot n will always contain more 2's than 5's; thus for our purposes it suffices to find the minimum n n so that the prime factorization of N N contains thirty 5's.

For p p a prime, every multiple of p p in the expansion of n ! n! will contribute one p p to the prime factorization of n ! n! ; however every multiple of p 2 p^2 will contribute two p p 's rather than one, and in general every multiple of p k p^k will contribute k k p p 's. Thus the number of p p 's in the prime factorization of n ! n! is given by

k = 1 n p k \displaystyle\sum_{k=1} \left\lfloor \dfrac{n}{p^k} \right\rfloor

Roughly, the prime factorizations of n ! n! and ( n + 1 ) ! (n+1)! will contain the same number of 5's, while the prime factorization of ( 2 n + 1 ) ! (2n+1)! will contain twice as many. Thus a good starting point for our minimum n n is a value for which n ! n! yields roughly a quarter of the required 5's, i.e. approximately seven. A quick calculation shows that n = 30 n=30 is the lowest value that yields seven 5's, as

30 5 + 30 5 2 = 6 + 1 = 7 \left\lfloor \dfrac{30}{5} \right\rfloor + \left\lfloor \dfrac{30}{5^2} \right\rfloor = 6+1=7

For n = 30 n=30 we have N = ( 30 ! ) ( 31 ! ) ( 61 ! ) N=(30!)(31!)(61!) , so the total number of five's in the prime factorization of N N is

( 30 5 + 30 5 2 ) + ( 31 5 + 31 5 2 ) + ( 61 5 + 61 5 2 ) = 7 + 7 + 14 = 28 \left( \left\lfloor \dfrac{30}{5} \right\rfloor + \left\lfloor \dfrac{30}{5^2} \right\rfloor \right) + \left( \left\lfloor \dfrac{31}{5} \right\rfloor + \left\lfloor \dfrac{31}{5^2} \right\rfloor \right) + \left( \left\lfloor \dfrac{61}{5} \right\rfloor + \left\lfloor \dfrac{61}{5^2} \right\rfloor \right) = 7+7+14 = 28

If we slowly increase n, we will obtain an additional 5 every time one of n , n + 1 n, n+1 or 2 n + 1 2n+1 becomes another multiple of 5. The first time this happens is for n = 32 n=32 when 2 n + 1 = 65 2n+1=65 ; the second is for n = 34 n=34 , when n + 1 = 35 n+1=35 . Thus when n = 34 n=34 , the prime factorization of N N will contain thirty 5's, so N N will end in a string of thirty zeroes, meaning that n ! ( n + 1 ) ! ( 2 n + 1 ) ! 1 n!(n+1)!(2n+1)!-1 will end in a string of thirty 9's.

Nice and detailed write-up! Did it exactly the same way.

Poca Poca - 3 years, 1 month ago
Giorgos K.
May 1, 2018

Using M a t h e m a t i c a Mathematica

Min@Select[Range@100,Mod[#!(#+1)!(2#+1)!-1,10^30]==FromDigits@Table[9,30]&]

returns 34 34

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...