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.

A224516 Number of solutions to x^4 - x == 0 (mod n).

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 4, 2, 4, 4, 2, 4, 4, 8, 4, 2, 2, 8, 4, 4, 8, 4, 2, 4, 2, 8, 4, 8, 2, 8, 4, 2, 4, 4, 8, 8, 4, 8, 8, 4, 2, 16, 4, 4, 8, 4, 2, 4, 4, 4, 4, 8, 2, 8, 4, 8, 8, 4, 2, 8, 4, 8, 16, 2, 8, 8, 4, 4, 4, 16, 2, 8, 4, 8, 4, 8, 8, 16, 4, 4, 4, 4, 2, 16, 4
Offset: 1

Views

Author

Eric M. Schmidt, Apr 09 2013

Keywords

Examples

			The solutions for n = 7 are 0, 1, 2, and 4.
		

Crossrefs

Programs

  • Mathematica
    f[3, e_] := If[e == 1, 2, 4]; f[p_, e_] := If[Mod[p, 3] == 2, 2, 4]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
  • Sage
    def A224516(n) :
        res = 1
        for p, m in factor(n) :
            if (p % 3 == 2) or (p == 3 and m == 1) : res *= 2
            else : res *= 4
        return res

Formula

Multiplicative with a(p^e) = 4 for p == 1 (mod 3); a(p^e) = 2 for p == 2 (mod 3); a(3^1) = 2; a(3^e) = 4 for e > 1.