What is the 50th smallest positive integer that can be written as the sum of one or more distinct powers of 3 with non-negative integer exponents?
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.
Consider the base 3 representation of all such elements. Since all the powers are distinct, they consist of the numbers 1 or 0. Thus, there is a bijection between such numbers, and the natural numbers written in binary, by changing the base from 3 to 2 , and vice versa. This function is an increasing function, so to find the 50th smallest number, we take 5 0 = 1 1 0 0 1 0 2 , and convert it to ternary to obtain 1 1 0 0 1 0 3 = 2 4 3 + 8 1 + 3 = 3 2 7 .
The problem requires that the integer be written as the "sum of distinct powers of 3." Can we think of 3^n as sum of distinct powers of 3?
Log in to reply
That's a good question. Can 3 n be written as the sum of distinct powers of 3? If so, how?
Log in to reply
No, it can't! k = 0 ∑ n − 1 3 k = 2 3 n − 1 < 3 n .
Well, can't think of 3 n , but it is possible to write every integer as a sum or difference of distinct powers of 3.
say N=3^x1 + 3^x2 +....+ 3^xn & x1<x2<...<xn
N=3^x1 . (1+3k)
where 3k=3^(x2-x1)+....+3^(xn-x1) clearly a multiple of 3
hence 3k+1 is not a multiple of 3 ===>N can't be a pure power of 3
Well it says "sum of one or more" ...
(Or has the wording been changed in the last few months? I can't tell from looking at the problem.)
Is it possible that this question is ambiguously worded? Here is another way to see the '50 smallest', and the 50th is 757.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
Log in to reply
You're missing a bunch:
Inserting these 11 solutions shows that your 39th solutions is in fact the 50th!
Gah, I forgot to take into account 3 0
same thought sir
This is the method I used and I like it the most because it is simple unlike other solutions that make use of weird symbols.
Sir why can't this combination of powers should be used. 3^0+3^1^0+3^1^1+3^1^2+.....+3^1^49 whose sum comes out to be 148.
The natural number can be represented as 3 x 1 + 3 x 2 + . . . + 3 x n where x1<x2<...<xn. First consider all the natural numbers which have 3^xn in their representation as the highest power of 3. The no. of such numbers = nC0+nC1+nC2+...+nCn=2^n. Let us call the group of such numbers as n-bracket. Apart from these brackets we have one more element i.e. 3^0=1. Now we arrange the brackets in the ascending order of their S.No. i.e. 1,1-bracket,2-bracket,... smallest element of n-bracket=3^n. Largest element of (n-1)-bracket= 3 1 + 3 2 + . . . + 3 n − 1 = 2 3 n − 3 which is smaller than 3^n. So as a whole the (n-1)-bracket is smaller than the n-bracket. So by arranging the individual elements of all the brackets and by arranging the brackets serial wise we will actually arrange all the elements in a sorted manner. No. of elements before n-bracket= 1 + 2 1 + 2 2 + . . . . + 2 n − 1 = 2 n − 1 . Interestingly, all the elements(except 3^n) of n-bracket can be obtained by adding 3^n to all the elements of the preceding brackets i.e. 1-bracket, 2-bracket,...,(n-1)-bracket. .......(1) Now, suppose we wish to find the k-th smallest number. In order to find the bracket to which the number belongs find n such that 2 n ≤ n u m b e r ≤ 2 n + 1 − 1 . The number belongs to n-bracket. After finding the bracket we only have to find the k-(2^n-1)th smallest number in the bracket. ........(2) Using fact (1) we can again break the n-bracket into its constituent brackets by ignoring 3^n. Once we find the number of the correct order we will simply add 3^n to it. ........(3) Care must be taken that after applying steps (2) and (3) once, we will have to look for (k-2^n)th smallest number in the smaller brackets. ........(4) We can reduce our search space by recursively using steps (2) & (3). But we need to define a reference point where we will end our recursive process. Let us have the following reference(sorted in ascending order): 1)0(in order to accommodate 3^n). 2)1 3)3 4)4 (1-bracket) 5)9 6)10 7)12 8)13 (2-bracket) So, if in our recursive process we are required to find the m-th smallest number ( 1 ≤ m ≤ 7 ) we simply look for the number corresponding to m-th serial number in the above reference list and accordingly add powers of 3 to it(as was stated in step 3). Care must be taken if the starting value of k is less than 9. In that case we should look for the (k+1)th element from the reference list. In case of k=8 the required number will obviously be 3^3=27. Now we pick up our case i.e. we find the 50th smallest number. note that 2 5 ≤ 5 0 ≤ 2 6 − 1 . So, the 50th smallest number is in 5-bracket. Now 5 0 − ( 2 5 − 1 ) = 1 9 a n d 2 4 ≤ 1 9 ≤ 2 5 − 1 . Inside the 5-bracket 50th smallest number is in the 4-bracket at the 1 9 − 2 4 = 3 p o s i t i o n . We reach the terminating condition 3 corresponds to 3. So, our required number is 3 5 + 3 4 + 3 = 3 2 7 .
It seems to me that the smallest is equal to 1, which corresponds to 3^0 rather than 3^1. As the 1st smallest corresponds to the binary representation of 0, the 50th smallest should correspond to the binary representation of 49, not 50. The correct answer should therefore be 3^5 + 3^4 + 3^0 = 325.
T h e r e p r e s e n t a t i o n o f t h e 5 0 t h s m a l l e s t s u c h n u m b e r w i l l
t h e r e f o r e b e t h e s a m e a s t h e r e p r e s e n t a t i o n o f t h e n u m b e r 5 0 i n
b a s e 2
5 0 1 0 = 1 1 0 0 1 0 2
1 1 0 0 1 0 3 = 3 5 + 3 4 + 3 1 = 3 2 7 1 0
Realised that each power of three can have all previously worked out answers added to it to make a new valid answer. Thirty-second value is 243 (3 to power 5) then find 18th number in original sequence (84) to add on
Since we need the sum as of powers of 3, it can be written as a n = [ b 0 ] ∗ 3 0 + [ b 1 ] ∗ 3 1 + . . . + [ b l ] ∗ 3 l , where a n is the nth smallest number possible and that b k (for any real k )= 0 or 1. To get the correct combination of { b 0 , . . . , b l } for each a n , we need to write n in terms of base 2. Now 50 in base 2=110010, so b 5 = 1 , b 4 = 1 , b 3 = 0 , b 2 = 0 , b 1 = 1 and b 0 = 0 and b m = 0 for m>5. So a 5 0 = 3 5 + 3 4 + 3 = 3 2 7
I did it just like Calvin said..
N=a0.3^0 +a1.3^1+a2.3^2+....+an.3^n+.....
ai=0 or 1 (ai-->i'th coefficient of above polynomial)
the No.s should to fit into this description...
since ai=0 or 1--> I used python to find (a0,a1,a2...)=bin(50)[:1;-1]
(coz the coeficients are either 1 or 0, combination of lower powers of 3 can't overtake higher powers of 3) hence 50thsmallest combination of powers of 3 is virtually given by bin(50)
==>(a0,a1,a2...)=tuple(bin(50)[:1:-1])=('0', '1', '0', '0', '1', '1')
==>50th smallest N=0* 3^0+1* 3^1+0* 3^2+0* 3^3+1* 3^4+1* 3^5= 327
Problem Loading...
Note Loading...
Set Loading...
Notice that 2 × 3 j < 3 j + 1 . This implies that i = 0 ∑ j 3 i < 3 j + 1 . This means that the function which accepts a binary integer a j a j − 1 … a 1 a 0 2 and returns i = 0 ∑ j a i × 3 i is a strictly increasing function. The binary representation of 50 is 1 1 0 0 1 0 2 , so the 50th smallest positive integer that can be written as the sum of distinct non-negative integer powers of 3 is 3 5 + 3 4 + 3 1 = 3 2 7 .
[Slight edits for clarity - Calvin]