JEE Novice - (9)

1 n + 2 n + 3 n + 4 n \large 1^n+2^n+3^n+4^n

For any positive integer n n , what is the largest possible trailing zeros of the of the expression above?

  • If you think that there is no such largest number, input 999 as your answer.
This question is a part of JEE Novices .


The answer is 2.

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.

4 solutions

Akash Deep
May 27, 2015

We define f n = i = 1 4 i n f_{n} = \sum_{i = 1}^4 i^{n} , first of all check for n = 1,2,3,4. In n = 4 the unit digit is not 0. n =4k +1, 4k+2 or 4k+3 now for odd cases of n f n = 1 n + 3 n + 2 n [ 2 n + 1 ] f_{n} = 1^n + 3^{n} + 2^{n} [2^{n} + 1] , 1 n + 3 n = 4 × ( 3 n 1 + . . . . . . + 3 0 ) 1^{n} + 3 ^ {n} = 4 ×(3^{n-1}+ ...... + 3 ^{0}) now note that there are n terms in the just above stated sum All of them are odd as 3 j 3^{j} is always odd , one pair of the odd terms when added becomes even but as there are n terms and n is odd one odd term will be lesft at last and odd + even is odd. So here maximum power of 2 dividing f n f_{n} is 2 as only 4 divides 1 n + 3 n 1^{n} + 3^{n} and so maximum zeroes at the end is 2. If we proceed similarly for the only even case n = 4k + 2 . We get maximum power of 2 dividing f n f_{n} is 1. Since we had to obtain maximum no of zeroes at the end of f n f_{n} our answer is of the odd case i.e. 2 \boxed{2}

For n=2k, 1 n + 3 n 2 ( m o d 4 ) 1^n+3^n \equiv 2 (\mod 4) ;

for n=2k+1, 1 n + 3 n 4 ( m o d 8 ) 1^n+3^n \equiv 4 (\mod 8) .

Puresky Walker - 6 years ago

Log in to reply

I didn't know how to insert the mod symbol so wrote in language

akash deep - 6 years ago

good solution !
did the same way ;)

Gaurav Jain - 6 years ago
Abdelhamid Saadi
May 28, 2015

let's define a n = 1 n + 2 n + 3 n + 4 n a _n = 1 ^ n + 2^ n + 3^n + 4^n

we can see that for n > 2 , a n = 2 n> 2, a_n = 2 ( m o d 8 ) (\mod 8) or a n = 4 ( m o d 8 ) a_n = 4 (\mod 8 )

So a n a_n has a maximum of two trailing zeros for n> 2.

and since a 0 = 1 , a 1 = 10 , a 2 = 30 , a 3 = 100. a_0 = 1, a_1 = 10, a_2 = 30, a_3 = 100.

The result is 2

Short and sweet nice one. c:

Kunal Verma - 6 years ago
Brock Brown
May 27, 2015

Python 2.7:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from time import time
def f(n):
    return 1**n + 2**n + 3**n + 4**n
def trailing_zeroes(n):
    count = 0
    for digit in str(n)[::-1]:
        if digit == '0':
            count += 1
        else:
            break
    return count
largest = 0
n = 0
seconds = 30
end = time() + seconds
while time() < end:
    count = trailing_zeroes(f(n))
    if count > largest:
        largest = count
    n += 1
print "Answer:", largest
print "Ran for", seconds, "seconds"
print "Tested up to n =", n-1

The problem with the computational approach is that it doesn't go on forever. How do you know there isn't some very large value of n which gives you 3, 4, 1000, so on?

Josh Banister - 6 years ago

Seeing you after a long time

Vaibhav Prasad - 6 years ago
Raushan Sharma
Jan 16, 2016

First note that n can't be divisible by 4 as in that case the expression is congruent to 4 modulo 10 and so it won't end in 0. So, if n is even, the highest power of 2 which will divide the expression is 1. So, we need to consider the case only for odd n whether it can end in more than 1 zeroes. Now, as n is odd, we can easily use LTE (Lifting The Exponent Lemma) on 3 n + 1 n 3^n + 1^n and 4 n + 2 n 4^n + 2^n separately and we get the answer as 2.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...