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 A065295 #20 Jun 09 2025 20:43:46 %S A065295 0,1,1,2,1,4,2,4,3,4,1,7,2,5,7,6,3,8,2,9,7,5,2,13,5,8,3,11,2,14,3,6,8, %T A065295 8,9,13,2,7,9,17,5,18,3,11,13,5,2,19,9,12,11,13,1,8,11,18,9,7,1,27,4, %U A065295 7,20,10,16,18,3,13,8,21,2,23,5,6,16,14,13,23,4,27,9,11,1,31,13,10,12,20 %N A065295 Number of values of s, 0 < s <= n-1, such that s^s == s (mod n). %C A065295 Note that a(1) = 0 by definition. - _Harry J. Smith_, Oct 15 2009 %H A065295 Harry J. Smith and T. D. Noe, <a href="/A065295/b065295.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Harry J. Smith) %e A065295 For n=5 we have (1^1) mod 5 = 1, (2^2) mod 5 = 4, (3^3) mod 5 = 2, (4^4) mod 5 = 1. Only for s=1 does (s^s) mod 5=s, so a(5)=1. %p A065295 a:= n-> add(`if`(s&^s-s mod n=0, 1, 0), s=1..n-1): %p A065295 seq(a(n), n=1..88); # _Alois P. Heinz_, Jun 09 2025 %t A065295 f[p_] := Module[{x = Range[p-1]}, Count[PowerMod[x, x, p] - x, 0]]; Table[f[n], {n, 100}] (* _T. D. Noe_, Feb 19 2014 *) %o A065295 (PARI) { for (n=1, 1000, a=0; for (s=1, n - 1, if (s^s % n == s, a++)); if (n==1, a=0); write("b065295.txt", n, " ", a) ) } \\ _Harry J. Smith_, Oct 15 2009 %o A065295 (PARI) a(n) = sum(s=1, n-1, Mod(s, n)^s == s); \\ _Michel Marcus_, Jun 03 2025 %Y A065295 Cf. A065296. %K A065295 nonn %O A065295 1,4 %A A065295 Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 28 2001 %E A065295 Definition revised by _N. J. A. Sloane_, Oct 15 2009.