Consider the set 'S(n)' formed by erasing digits at some (0 or more) positions of a number 'n'.
For example: if n=123, S(123)={123,12,13,23,1,2,3}.
Another one: if n=122, S(122)={122,12,12,22,1,2,2}.
Let 's' denote the sum of all elements of 'S'. Find s%9 for n=12391227.
Note:
1) '%' means remainder. 5%2=1.
Some Identities:
2) (a+b)%c=(a%c+b%c)%c
3) (a*b)%c=((a%c)*(b%c))%c.
0?
ReplyDeleteclarification:
ReplyDeletelets take 122:
erasing nothing : 122
erasing position 1: 12
erasing position 2: 12 (again)
erasing position 3: 22
erasing position 1 and 2 : 1
erasing position 2 and 3 : 2
erasing position 3 and 1 : 3
sum=122+12+12+22+1+2+3
ans=sum%9
Ya,i also got the same answer,zero
ReplyDeleteIdentities were quite usefull
ReplyDeleteis the answer correct?
ReplyDeletewith use of properties it is quite simple
ReplyDeleteif someone hasn't solved it yet, here's a hint:
ReplyDelete(93928)%9=(9+3+9+2+8)%9.
i.e. if 'b' is the sum of digits in 'a', then
a%9=b%9.
everyone should try this one, as it helps you revise a standard PnC problem:
i too guess its zero..
ReplyDelete0
ReplyDelete