cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385662 Number of divisors d of n such that d^d == (-d)^d (mod n).

This page as a plain text file.
%I A385662 #33 Aug 23 2025 00:00:38
%S A385662 1,2,1,2,1,3,1,3,2,3,1,4,1,3,1,4,1,5,1,4,1,3,1,6,2,3,3,4,1,5,1,5,1,3,
%T A385662 1,6,1,3,1,6,1,5,1,4,2,3,1,8,2,5,1,4,1,7,1,6,1,3,1,8,1,3,2,6,1,5,1,4,
%U A385662 1,5,1,9,1,3,2,4,1,5,1,8,3,3,1,8,1,3,1,6,1,8,1,4,1,3,1,10,1,5,2,6
%N A385662 Number of divisors d of n such that d^d == (-d)^d (mod n).
%C A385662 From _Robert Israel_, Aug 04 2025: (Start)
%C A385662 If n is divisible by 4, a(n) = A000005(n/2).
%C A385662 If n is odd, a(n) is the number of divisors d of n such that n divides d^d.
%C A385662 If n = 2 * m with m odd, a(n) = A000005(m) + a(m). (End)
%p A385662 f:= proc(n) if n::odd then nops(select(d -> d &^ d mod n = 0, numtheory:-divisors(n)))
%p A385662        elif n mod 4 = 0 then numtheory:-tau(n/2)
%p A385662        else numtheory:-tau(n/2) + procname(n/2) fi
%p A385662 end proc:
%p A385662 map(f, [$1..100]); # _Robert Israel_, Aug 04 2025
%t A385662 a[n_] := DivisorSum[n, 1 &, PowerMod[#, #, n] == PowerMod[-#, #, n] &]; Array[a, 100] (* _Amiram Eldar_, Aug 04 2025 *)
%o A385662 (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]];
%o A385662 (PARI) a(n) = sumdiv(n, d, Mod(d, n)^d == Mod(-d, n)^d); \\ _Michel Marcus_, Aug 04 2025
%Y A385662 Cf. A000005, A384237, A384834, A384854, A385392, A385318.
%K A385662 nonn,changed
%O A385662 1,2
%A A385662 _Juri-Stepan Gerasimov_, Aug 03 2025