OFFSET
2,4
COMMENTS
Conjecture: Let p be any odd prime, and let t(p) be the number of ordered pairs (i,j) with 0 < i < j < p/2 and (i^4 mod p) > (j^4 mod p). If p is not congruent to 7 modulo 8, then t(p) == floor((p-1)/8) (mod 2). When p == 7 (mod 8), we have t(p) == (p+1)/8 + (h(-p)+1)/2 (mod 2), where h(-p) denotes the class number of the imaginary quadratic field Q(sqrt(-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(5) = 3 since prime(5) = 11, and the only ordered pairs (i, j) with 0 < i < j < 11/2 and (i^4 mod 11) > (j^4 mod 11) are (2, 3), (2, 4), (3, 4).
MATHEMATICA
f[k_, p_] := f[k, p] = PowerMod[k, 4, p]; 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, 50}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Sep 30 2018
STATUS
approved