close
login
A378387
a(n) is the number of proper divisors d of n such that (-d)^n == -d (mod n).
2
0, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 1, 3, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 0, 3, 4, 1, 0, 2, 4, 1, 1, 1, 1, 2, 1, 1, 2, 1, 0, 1, 1, 1, 0, 2, 1, 2, 0, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0
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
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
Sequence in context: A298941 A317146 A194297 * A100544 A031214 A130654
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Jan 11 2025
STATUS
approved