Algorithmic puzzle · integer answermedium50 min
Odd totient multiples
Divisor Arithmetic
How many odd integers n with 3<=n<=50000 have Euler totient phi(n) divisible by 12?
Solve using mathematics, algorithms, or your own code offline. Submit only the final integer here—no program, expression, graph, or written proof.
Check your answer without signing in. Sign in to save your progress.
How to approach this problem
Compute totients with a sieve: initialize φ(n)=n and for each prime p update its multiples by φ←φ−φ/p. Filter the odd candidates and apply the divisibility condition.
Worked example with different values
φ(15)=15(1−1/3)(1−1/5)=8; exactly eight positive integers up to 15 are coprime to it.
Apply the same reasoning to the challenge. This example is a separate practice problem.
Learn the technique: Number theory: divisors, gcd and modular arithmetic