A384854 The number of divisors d of n such that (-d)^d == d (mod n).
1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 5, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[1+#[s: s in [1..n-1] | n mod s eq 0 and Modexp((-s), s, n) eq s]: n in [1..100]];
-
Maple
a:= n-> add(`if`((-d)&^d-d mod n=0, 1, 0), d=numtheory[divisors](n)): seq(a(n), n=1..100); # Alois P. Heinz, Jun 10 2025
-
PARI
a(n) = sumdiv(n, d, Mod(-d, n)^d == d); \\ Michel Marcus, Jun 11 2025
Formula
a(n) = 1 + number of proper divisors h of n such that (-h)^h = h (mod n).