1. ## help needed

can any 1 plz help me in solving this problem
http://www.spoj.pl/problems/MZVRK/

here's what i have

Code:
```=> the zvrks of any odd number will be =1 .
=> all the numbers (when the process is done) will have exactly one '1' & remaining
zeros hence when converted back to decimal each number will be in the form 2^k .
=> these numbers have certain pattern .

ex: if sum of all zvrks from 2^k <=> 2^k+1 is Z , then sum of all zvrks of 2^k+1 <=>
2^k+1 will be 2*Z+(2^k+1 - 2^k) . [:P]

but nt able to proceed after this```
I'd be grateful if any 1 can help !

thank u very much

2. ## Hey ... Is this homework?

I hope this is not homework...
but I will give some hints anyway.

A way of doing this could be converting your number to binary and doing all the stuff as normal people.

But, realize that the whirligig of a number is always a number of the form 1000 ... 000 and that number could be represented as pow(2,n) where n is the number of digits of your whirligig number.

You could extract the right most n digits and then compare it to pow(2,n) if is equal then you have your whirligig number , if not you increment n by one and compare again.

For extracting the left most n binary digits of a integer study about exclusive disjunction (logic or, logic and etc)

I hope you can do it with this algorithm...

Originally Posted by jack_carver
can any 1 plz help me in solving this problem
http://www.spoj.pl/problems/MZVRK/

here's what i have

Code:
```=> the zvrks of any odd number will be =1 .
=> all the numbers (when the process is done) will have exactly one '1' & remaining
zeros hence when converted back to decimal each number will be in the form 2^k .
=> these numbers have certain pattern .

ex: if sum of all zvrks from 2^k <=> 2^k+1 is Z , then sum of all zvrks of 2^k+1 <=>
2^k+1 will be 2*Z+(2^k+1 - 2^k) . [:P]

but nt able to proceed after this```
I'd be grateful if any 1 can help !

thank u very much