write n, n-1 to base 3
check if thr & gives 0, if it gives no. is of form 3^n

On Fri, Jan 21, 2011 at 8:04 PM, snehal jain <[email protected]> wrote:

> @manmeet
> how?
>
>
> On Fri, Jan 21, 2011 at 7:36 PM, Manmeet Singh <[email protected]>wrote:
>
>> @juver++ : the above is a user defined function. but its possible to the
>> problem using bit wise operators.
>>
>>
>> On Fri, Jan 21, 2011 at 7:29 PM, juver++ <[email protected]> wrote:
>>
>>> @above it's a user-defined function using fast exponentiation
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<algogeeks%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<algogeeks%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to