# Abelianness-forcing number Q

In the theory of finite abstract group, abelianness-forcing number $$n$$ is characterized as a positive integer with standard factorization $$n=p_1^{k_1}p_2^{k_2}\cdots p_r^{k_r}$$ with $$k_i \le 2$$ and $$p_i$$ does not divide $$p_j^{k_j}-1$$ for any $$1 \le i,j \le r$$. I want to define a function "AbeliannessForcingNumberQ" which returns "True" if and only if the argument is a abeliannes-forcing number. But I cannot figure out how to deal with prime factors and exponents in a given number. Please help to define this function.

abeliannessForcingNumberQ[n_Integer] := And @@ Flatten[{
Table[Not@Divisible[Power @@ p - 1, q], {p, FactorInteger[n]}, {q, First /@ FactorInteger[n]}],

• As a minor correction, we should include $1$ as an abelianness forcing number. – seoneo Oct 28 '19 at 4:24