OFFSET
1,2
COMMENTS
From Robert Israel, Aug 04 2025: (Start)
If n is divisible by 4, a(n) = A000005(n/2).
If n is odd, a(n) is the number of divisors d of n such that n divides d^d.
If n = 2 * m with m odd, a(n) = A000005(m) + a(m). (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) if n::odd then nops(select(d -> d &^ d mod n = 0, numtheory:-divisors(n)))
elif n mod 4 = 0 then numtheory:-tau(n/2)
else numtheory:-tau(n/2) + procname(n/2) fi
end proc:
map(f, [$1..100]); # Robert Israel, Aug 04 2025
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, PowerMod[#, #, n] == PowerMod[-#, #, n] &]; Array[a, 100] (* Amiram Eldar, Aug 04 2025 *)
PROG
(Magma) [1 + #[d: d in [1..n-1] | n mod d eq 0 and Modexp(d, d, n) eq Modexp(-d, d, n)]: n in [1..100]];
(PARI) a(n) = sumdiv(n, d, Mod(d, n)^d == Mod(-d, n)^d); \\ Michel Marcus, Aug 04 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 03 2025
STATUS
approved
