All numbers are happy in base 2; so you may effectively leave 2 out of your calculations.
On Tue, May 25, 2010 at 4:31 PM, TripleM <[email protected]> wrote: > '11' is definitely happy in base 2. The square of the digits add to > '10' in base 2; the squares of those digits add to 1. > > On May 25, 8:11 pm, maverick gugu <[email protected]> wrote: > > Hi, > > i think i'm misinterpreting this question from that time. In the test > > cases given in the question: > > > > The first one are bases 2 and 3. > > The output for this input is given as 3. > > But 3 when written in base 2 is 11 which is not a happy number. > > > > According to my code: I'm getting the smallest happy number > 1 for bases > 2 > > and 3 is 128. > > > > Can you please help me out with this? Is my understanding wrong? > > > > Thanks, > > Maverick > > > > -- > > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]<google-code%[email protected]> > . > > For more options, visit this group athttp:// > groups.google.com/group/google-code?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-code%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-codejam" 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/google-code?hl=en.
