OFFSET
2,4
COMMENTS
Conjecture: Let p be an odd prime, and let r(p) be the number of ordered pairs (i,j) with 0 < i < j < p/2 and R(i^4,p) > R(j^4,p), where R(k,p) denotes the unique integer r among 0,...,(p-1)/2 with k congruent to r or -r modulo p. Then r(p) is even if p == 3 (mod 4). Also, r(p) == (p-5)/8 (mod 2) if p == 5 (mod 8). When p == 1 (mod 8), r(p) is even if and only if 2 is a quartic residue modulo p.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 2..1000
Zhi-Wei Sun, Quadratic residues and related permutations, arXiv:1809.07766 [math.NT], 2018.
EXAMPLE
a(6) = 3 since prime(6) = 13, (R(1^4,13),R(2^4,13),...,R(6^4,13)) = (1,3,3,9,1,9), and (2,5), (3,5) and (4,5) are only pairs (i,j) with 0 < i < j < 13/2 and R(i^4,13) > R(j^4,13).
MATHEMATICA
f[k_, p_]:=f[k, p]=Abs[Mod[PowerMod[k, 4, p], p, -p/2]]; Inv[p_]:=Inv[p]=Sum[Boole[f[i, p]>f[j, p]], {j, 2, (p-1)/2}, {i, 1, j-1}]; Table[Inv[Prime[n]], {n, 2, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Sep 30 2018
STATUS
approved