b3d0b16

committed
# Commits

# Comments (0)

# Files changed (2)

# src/main/scala/s99/ArithmeticSolutions.scala

# src/test/scala/s99/ArithmeticSpec.scala

See problem P34 for the definition of Euler's totient function. If the list of the prime factors of a number m is

- known in the form of problem P36 then the function phi(m>) can be efficiently calculated as follows:

+ known in the form of problem P36 then the function phi(m>1) can be efficiently calculated as follows:

Let [[p1, m1], [p2, m2], [p3, m3], ...] be the list of prime factors (and their multiplicities) of a given number m.