cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A317581 a(1) = 1; a(n > 1) = 1 + Sum_{d|n, d

Original entry on oeis.org

1, 0, 0, 1, 0, 2, 0, 0, 1, 2, 0, -2, 0, 2, 2, 1, 0, -2, 0, -2, 2, 2, 0, 4, 1, 2, 0, -2, 0, -6, 0, 0, 2, 2, 2, 7, 0, 2, 2, 4, 0, -6, 0, -2, -2, 2, 0, -4, 1, -2, 2, -2, 0, 4, 2, 4, 2, 2, 0, 16, 0, 2, -2, 1, 2, -6, 0, -2, 2, -6, 0, -12, 0, 2, -2, -2, 2, -6, 0, -4
Offset: 1

Views

Author

Gus Wiseman, Jul 31 2018

Keywords

Comments

If p is prime, a(p^k) = 0 if k is odd, 1 if k is even. - Robert Israel, Aug 01 2018

Crossrefs

Programs

  • Maple
    f:= n -> 1 + add(numtheory:-mobius(n/d)*procname(d),d=numtheory:-divisors(n) minus {n}):
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Aug 01 2018
  • Mathematica
    a[n_]:=1+Sum[MoebiusMu[n/d]*a[d],{d,Most[Divisors[n]]}];
    Array[a,100]
  • Python
    from sympy import mobius, divisors
    def A317581(n): return 1 + (0 if n == 1 else sum(mobius(n//d)*A317581(d) for d in divisors(n,generator=True) if d < n)) # Chai Wah Wu, Jan 14 2022