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.

A385638 Number of nonnegative s < n such that (-s)^s == -s^s (mod n).

This page as a plain text file.
%I A385638 #32 Aug 22 2025 02:16:27
%S A385638 1,2,1,3,2,3,3,7,5,5,5,7,6,7,7,14,8,11,9,11,10,11,11,15,14,13,17,15,
%T A385638 14,15,15,30,16,17,17,23,18,19,19,23,20,21,21,23,23,23,23,31,27,29,25,
%U A385638 27,26,35,27,31,28,29,29,31,30,31,32,62,32,33,33,35,34,35,35,47
%N A385638 Number of nonnegative s < n such that (-s)^s == -s^s (mod n).
%C A385638 Every odd s < n satisfies the condition. An even s works only when n divides 2*s^s. Thus a(n) = floor(n/2) plus the even s that satisfy this test. For an odd prime p >= 3, no even s works, so a(p) = (p - 1) / 2.  With 0^0 = 1, s = 0 works only for n = 1 or 2. - _Robert P. P. McKone_, Aug 07 2025
%t A385638 a[n_] := Count[Range[0, n-1], _?(PowerMod[-#, #, n] == Mod[-PowerMod[#, #, n], n] &)]; Array[a, 100] (* _Amiram Eldar_, Aug 07 2025 *)
%o A385638 (Magma) [#[s: s in [0..n-1] | Modexp(-s,s,n) eq -Modexp(s,s,n) mod n]: n in [1..100]];
%Y A385638 Cf. A065295, A384781, A385103, A385318, A386409.
%K A385638 nonn,changed
%O A385638 1,2
%A A385638 _Juri-Stepan Gerasimov_, Aug 06 2025