A378387 a(n) is the number of proper divisors d of n such that (-d)^n == -d (mod n).
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
Keywords
Examples
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).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[#[d: d in [1..n-1] | n mod d eq 0 and (-d)^n mod n eq n-d]: n in [1..100]];
-
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 *)
Extensions
Edited by N. J. A. Sloane, Jan 11 2025
Comments