%I #58 Sep 08 2022 08:46:25
%S 1,2,2,3,2,4,2,4,3,4,2,5,2,4,4,5,2,6,2,5,2,4,2,7,3,4,4,5,2,8,2,6,2,4,
%T 2,9,2,4,4,7,2,6,2,5,6,4,2,9,3,6,4,5,2,8,2,7,2,4,2,9,2,4,5,7,2,6,2,5,
%U 2,6,2,10,2,4,6,5,1,8,2,9,5,4,2,9,4,4,4,7,2,12,4,5,2,4,2,11
%N a(n) is the number of divisors of n such that the ratio (the number of nonnegative m < n such that m^d == m (mod n))/(the number of nonnegative m < n such that -m^d == m (mod n)) is also a divisor of n.
%C a(n) is the number of ordered pairs (x,y) of divisors of n such that the ratio (the number of nonnegative m < n such that m^x == m (mod n)) / (the number of nonnegative m < n such that -m^x == m (mod n))) is equal to y. These pairs of divisors of each n define the direction of the arcs of some directed graph, the vertices of the number a(n) of which are indicated by the corresponding values of the divisors.
%C 1 <= a(n) <= tau(n) where tau(n) is the number of divisors of n.
%C The boundary sequences of this relation are A338189 (numbers i such that a(i) = 1) and A338190 (numbers j such that a(j) = tau(j)).
%C Furthermore, for any nonnegative k, 1 <= the ratio (the number of nonnegative m < n such that m^k == m (mod n)) / (the number of nonnegative m < n such that -m^k == m (mod n)) <= n.
%C The number of divisors d such that A334006(n,d) is also a divisor of n. - _Peter Kagey_, Sep 09 2020
%H Michel Marcus, <a href="/A337454/b337454.txt">Table of n, a(n) for n = 1..5000</a>
%e a(1) = 1 solution is pair (x,y) of divisors of n = 1 is (1,1).
%e a(2) = 2 solutions are pairs (x,y) of divisors of n = 2 are (1,1) and (2,1).
%e a(3) = 2 solutions are pairs (x,y) of divisors of n = 3 are (1,3) and (3,3).
%e a(4) = 3 solutions are pairs (x,y) of divisors of n = 4 are (1,2), (2,1) and (4,1).
%o (Magma) [#[d: d in Divisors(n) | Denominator(n*#[m: m in [0..n-1] | -m^d mod n eq m]/#[m: m in [0..n-1] | m^d mod n eq m]) eq 1]: n in [1..96]];
%o (PARI) a(n) = sumdiv(n, d, n % (sum(m=0, n-1, Mod(m, n)^d == m)/sum(m=0, n-1, Mod(-m, n)^d == m)) == 0); \\ _Michel Marcus_, Aug 30 2020
%Y Cf. A000005, A001317, A019434, A334006, A336664, A337454.
%Y Cf. also A338189, A338190.
%K nonn
%O 1,2
%A _Juri-Stepan Gerasimov_, Aug 27 2020