new_formula_for_A058026 -- important.txt 373 B

12345678910111213141516171819
  1. # Added
  2. # https://oeis.org/A058026
  3. # 1, 0, 1, 0, 3, 0, 5, 0, 3, 0, 9, 0, 11, 0, 3, 0, 15, 0, 17, 0, 5, 0
  4. a(n) = phi(n) * Sum_{d|n} mu(d) / phi(d), where mu(k) is the Moebius function and phi(k) is the Euler totient function. - ~~~~
  5. # Sidef program
  6. func foo(n) {
  7. euler_phi(n) * n.divisors.sum { |d|
  8. mobius(d) / euler_phi(d)
  9. }
  10. }
  11. say 30.of { foo(_) }