views:

469

answers:

1

I have been trying to tackle this problem, but I am having difficulty understanding it:

Let φ be Euler's totient function, i.e. for a natural number n, φ(n) is the number of k, 1 <= k <= n, for which gcd(k,n) = 1.

By iterating φ, each positive integer generates a decreasing chain of numbers ending in 1. E.g. if we start with 5 the sequence 5,4,2,1 is generated. Here is a listing of all chains with length 4:

5,4,2,1
7,6,2,1
8,4,2,1
9,6,2,1
10,4,2,1
12,4,2,1
14,6,2,1
18,6,2,1

Only two of these chains start with a prime, their sum is 12.

What is the sum of all primes less than 40000000 which generate a chain of length 25?

My understanding of this is that the φ(5) is 4, 2, 1 - ie the coprimes to 5 are 4, 2 and 1 - but then why isn't 3 in that list too? And as for 8, I would say that 4 and 2 are not coprime to 8...

I guess I must have misunderstood the question...

Assuming the question is worded badly, and that φ(5) is 4, 3, 2, 1 as a chain of 4. I don't find any primes that are less than 40m which generate a chain of 25 - I find some chains of 24, but they are relate to non-prime numbers.

+3  A: 

"Iterating the function" means running the function on it's own result. Like: φ(5) = 4; φ(4) = 2; φ(2) = 1; Thus, we get your chain of 5-4-2-1. The same with all the other chains.

Vilx-
doh - thanks for that
Chris Kimpton