OFFSET
1,4
COMMENTS
Note that a(1) = 0 by definition. - Harry J. Smith, Oct 15 2009
LINKS
Harry J. Smith and T. D. Noe, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harry J. Smith)
EXAMPLE
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
MATHEMATICA
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 *)
PROG
(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]
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 28 2001
EXTENSIONS
Definition revised by N. J. A. Sloane, Oct 15 2009.
STATUS
approved