#abc230g. [abc230_g]GCD Permutation

[abc230_g]GCD Permutation

给你一个长度为 NN 的排列 P=(P1,P2,...,PN)P=(P_1,P_2,...,P_N),你需要求出有多少 (i,j)(i,j) 满足 $1\leq i \leq j \leq N,\gcd(i,j)\ne 1,\gcd(P_i,P_j)\ne 1$。