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 A385540 #12 Jul 09 2025 10:15:49 %S A385540 1,1,0,0,0,2,1,0,1,2,0,1,0,3,2,0,0,4,0,1,2,3,1,1,2,4,1,3,0,4,1,0,3,2, %T A385540 1,3,1,3,2,1,1,6,0,3,4,3,1,1,3,6,2,2,0,4,3,2,1,3,0,3,1,3,7,0,3,6,0,1, %U A385540 3,6,1,3,1,4,5,3,4,6,1,1,4,3,0,5,0,4,4,2,1,8,4,2,3,3,2,1,0,8,5,5 %N A385540 Number of values of nonnegative s < n such that s^s == (-s)^s == s (mod n). %t A385540 a[n_] := Count[Range[0, n-1], _?(PowerMod[#, #, n] == PowerMod[-#, #, n] == # &)]; Array[a, 100] (* _Amiram Eldar_, Jul 03 2025 *) %o A385540 (Magma) [#[s: s in [0..n-1] | Modexp(s,s,n) eq s and Modexp(-s,s,n) eq s]: n in [1..100]]; %o A385540 (PARI) a(n) = sum(s=0, n-1, (s == Mod(s, n)^s) && (s == Mod(-s, n)^s)); \\ _Michel Marcus_, Jul 09 2025 %Y A385540 Cf. A065295, A384781, A385541. %K A385540 nonn %O A385540 1,6 %A A385540 _Juri-Stepan Gerasimov_, Jul 02 2025