Page 1 of 1

Problem 069

Posted: Sun Feb 22, 2009 12:37 am
by MaJJ
I have a code that works, but gets slow at big numbers becouse of GCD.
I don't see how to apply memoization or some handy break...

Any ideas how to get rid of GCD, please?

Re: Problem 069

Posted: Sun Feb 22, 2009 2:13 am
by daniel.is.fischer
I don't want to give too much of a hint, but google might find one or two sources which explain how to calculate [phi](n) efficiently.