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 A386409 #16 Aug 23 2025 00:04:13 %S A386409 1,1,2,2,2,4,2,4,3,4,3,7,5,5,6,6,4,6,4,9,8,5,2,13,4,8,3,9,4,14,3,6,7, %T A386409 8,12,11,3,7,10,17,5,16,6,9,10,5,2,19,7,8,10,13,3,6,11,18,11,7,3,27,5, %U A386409 7,14,10,16,17,5,13,7,21,4,21,5,6,14,12,12,21,5,27,6,11,3,29,16,10,9,19,4,23 %N A386409 Number of nonnegative values s < n such that (-s)^s == -s (mod n). %t A386409 a[n_] := Count[Range[0, n-1], _?(PowerMod[-#, #, n] == n - # &)]; a[1] = 1; Array[a, 100] (* _Amiram Eldar_, Jul 21 2025 *) %o A386409 (Magma) [#[s: s in [0..n-1] | Modexp(-s, s, n) eq n-s mod n]: n in [1..90]]; %o A386409 (PARI) a(n) = sum(s=0, n-1, Mod(-s, n) == Mod(-s, n)^s); \\ _Michel Marcus_, Aug 22 2025 %Y A386409 Cf. A065295, A384781, A385103, A385540, A385729. %K A386409 nonn,changed %O A386409 1,3 %A A386409 _Juri-Stepan Gerasimov_, Jul 20 2025 %E A386409 a(1) corrected by _Andrew Howroyd_, Aug 22 2025