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.
%I A384781 #18 Jun 17 2025 19:29:31 %S A384781 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, %T A384781 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, %U A384781 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 %N A384781 Number of values of s, 0 < s <= n - 1, such that (-s)^s == s (mod n). %p A384781 a:= n-> add(`if`((-s)&^s-s mod n=0, 1, 0), s=1..n-1): %p A384781 seq(a(n), n=1..100); # _Alois P. Heinz_, Jun 09 2025 %t A384781 a[n_]:=Length[Select[Range[n-1],PowerMod[-#,#,n]==# &]]; Array[a,100] (* _Stefano Spezia_, Jun 11 2025 *) %o A384781 (Magma) [#[s: s in [1..n-1] | Modexp((-s),s,n) eq s]: n in [1..100]]; %o A384781 (PARI) a(n) = sum(s=1, n-1, Mod(-s, n)^s == s); \\ _Michel Marcus_, Jun 11 2025 %Y A384781 Cf. A065295, A151821, A373901 (k such that a(k) = 0), A382752, A384854. %K A384781 nonn %O A384781 1,6 %A A384781 _Juri-Stepan Gerasimov_, Jun 09 2025