View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Eulier Totient Function

Hi David. I could not find any identities where we could cut down the
number of loops.


Oh! Never mind!! :(
Just call a Prime Factor routine, keeping just the prime numbers.
For example, if n=2,000,000, then just collect 2 & 5.

n = 2,000,000;
Hence:

n*(1 - 1/2)*(1 - 1/5)
800,000

Which checks:

EulerPhi(n)
800,000
--
Dana DeLouis
<snip