OFFSET
1,6
COMMENTS
From Robert Israel, Dec 27 2024: (Start)
If n > 1 is odd, a(n) > 0 as d = 1 works.
a(n) = 1 if n is a prime power (A246655). (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 0 because the proper divisors of 4 are 1, 2 and
(-1)^4 (mod 4) is not congruent to 3 (mod 4);
(-2)^4 (mod 4) is not congruent to 2 (mod 4).
a(5) = 1 because the only proper divisor of 5 is 1 and
(-1)^5 (mod 5) == 4 (mod 5).
MAPLE
f:= proc(n) nops(select((t -> (-t)&^n + t mod n = 0), numtheory:-divisors(n) minus {n})) end proc:
map(f, [$1..100]); # Robert Israel, Dec 27 2024
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, # < n && PowerMod[n - #, n, n] == n - # &]; Array[a, 100] (* Amiram Eldar, Dec 23 2024 *)
PROG
(Magma) [#[d: d in [1..n-1] | n mod d eq 0 and (-d)^n mod n eq n-d]: n in [1..100]];
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Dec 23 2024
EXTENSIONS
Edited by N. J. A. Sloane, Jan 11 2025
STATUS
approved
