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.

A384781 Number of values of s, 0 < s <= n - 1, such that (-s)^s == s (mod n).

Original entry on oeis.org

0, 1, 0, 0, 1, 2, 1, 0, 1, 4, 0, 1, 1, 3, 3, 0, 0, 4, 0, 1, 2, 3, 1, 1, 3, 6, 1, 3, 1, 6, 1, 0, 3, 2, 2, 3, 3, 3, 2, 1, 1, 6, 0, 3, 5, 3, 1, 1, 3, 8, 2, 2, 2, 4, 3, 2, 1, 5, 0, 3, 3, 3, 7, 0, 5, 6, 0, 1, 3, 8, 1, 3, 3, 8, 5, 3, 4, 6, 1, 1, 4, 3, 0, 5, 2, 4, 6, 2, 4, 10, 5, 2, 3, 3, 2, 1, 4, 8, 5, 5
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 09 2025

Keywords

Crossrefs

Cf. A065295, A151821, A373901 (k such that a(k) = 0), A382752, A384854.

Programs

  • Magma
    [#[s: s in [1..n-1] | Modexp((-s),s,n) eq s]: n in [1..100]];
    
  • Maple
    a:= n-> add(`if`((-s)&^s-s mod n=0, 1, 0), s=1..n-1):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 09 2025
  • Mathematica
    a[n_]:=Length[Select[Range[n-1],PowerMod[-#,#,n]==# &]]; Array[a,100] (* Stefano Spezia, Jun 11 2025 *)
  • PARI
    a(n) = sum(s=1, n-1, Mod(-s, n)^s == s); \\ Michel Marcus, Jun 11 2025