OFFSET
1,2
COMMENTS
a(n) is always an integer. If p == 1 (mod 8), then (-4)^((p-1)/4) == 4^((p-1)/4) == 2^((p-1)/2) (mod p). 2 is a quadratic residue modulo p so 2^((p-1)/2) == 1 (mod p). If p == 5 (mod 8), then (-4)^((p-1)/4) == -4^((p-1)/4) == -2^((p-1)/2) (mod p). 2 is a quadratic nonresidue modulo p so 2^((p-1)/2) == -1 (mod p). Furthermore, for n > 1, a(n) is always an odd multiple of 5.
(-4)^((p-1)/4) == 1 (mod p) implies -4 is always a quartic residue modulo p. Note that x^4 + 4 = (x^2 + 2)^2 - (2x)^2 = (x^2 + 2x + 2)(x^2 - 2x + 2) = ((x + 1)^2 + 1)*((x - 1)^2 + 1), so the solutions to x^4 == -4 (mod p) are x == ((p - 1)/2)! + 1, ((p - 1)/2)! - 1, -((p - 1)/2)! + 1 and -((p - 1)/2)! - 1 (mod p).
EXAMPLE
The second prime congruent to 1 mod 4 is 13, so a(2) = ((-4)^3 - 1)/13 = (-65)/13 = -5. Also, the four solutions to x^4 == -4 (mod 13) are x == 4, 6, 7 and 9 (mod 13).
MATHEMATICA
seq[max_] := Table[((-4)^((p-1)/4) - 1)/p, {p, Select[Prime[Range[max]], Mod[#, 4] == 1 &]}]; seq[50] (* Amiram Eldar, Mar 11 2026 *)
PROG
(PARI) forstep(p=5, 100, 4, if(isprime(p), print1(((-4)^((p-1)/4)-1)/p, ", ")))
CROSSREFS
KEYWORD
sign
AUTHOR
Jianing Song, Sep 05 2018
STATUS
approved
