OFFSET
1
COMMENTS
The row lengths sequence is A006093(n) = prime(n) - 1, n>=1.
Due to the little Fermat theorem T(n,k)^2 == +1 (mod prime(n)). For n>=2 there are the two incongruent solutions + 1 and -1 of y^2 === +1 (mod prime (n)). k^q(n) = + 1 (mod prime(n)) has for n>=2 at most q(n) incongruent solutions, similarly for k^q(n) = -1 (mod prime(n)). All-together there are prime(n)-1 = 2*q(n) incongruent solutions of k^(2*q(n)) == +1 (mod prime(n)) (little Fermat for k=1,..,p-1), hence each row of this array has only +1 and -1 values, and both values appear (prime(n)-1)/2 times.
See, e.g., the first part of the Holsztyński Włodzimierz blog given in the link.
LINKS
Holsztyński Włodzimierz, Congruence x^2==-1 (mod p) (Euler), and a super-Wilson Theorem
FORMULA
T(n,k) = k^((prime(n)-1)/2) (mod prime(n)) for n >= 2 and k=1,2,...,prime(n)-1; T(1,1) = +1.
EXAMPLE
n, p(n)\k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1, 2 +1
2, 3 +1 -1
3, 5 +1 -1 -1 +1
4, 7 +1 +1 -1 +1 -1 -1
5, 11 +1 -1 +1 +1 +1 -1 -1 -1 +1 -1
6, 13 +1 -1 +1 +1 -1 -1 -1 -1 +1 +1 -1 +1
7, 17 +1 +1 -1 +1 -1 -1 -1 +1 +1 -1 -1 -1 +1 -1 +1 +1
8, 19 +1 -1 -1 +1 +1 +1 +1 -1 +1 -1 +1 -1 -1 -1 -1 +1 +1 -1
...
MATHEMATICA
Table[Table[PowerMod[a, (p - 1)/2, p], {a, 1, p - 1}] /. _?(# > 1 &) -> -1, {p, Prime[Range[10]]}] // Grid (* Geoffrey Critzer, Jan 04 2015 *)
CROSSREFS
KEYWORD
sign,tabf
AUTHOR
Wolfdieter Lang, May 04 2012
STATUS
approved