%I #6 Mar 02 2016 04:56:40
%S 0,1,0,-1,1,0,1,-1,-1,1,0,-1,-1,1,-1,1,1,0,-1,1,-1,-1,-1,1,1,1,-1,1,0,
%T 1,-1,1,1,-1,-1,-1,-1,1,1,-1,1,0,1,1,-1,1,-1,-1,-1,1,1,-1,-1,-1,1,-1,
%U 1,1,0,-1,1,1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,1,-1,-1,1
%N Irregular triangle with the Legendre symbol (-m / prime(n)) for m = 0,1, ..., prime(n)-1, for n >= 1. Caution for row n = 1.
%C Row n has length prime(n) = A000040(n).
%C If GCD(-m, prime(n)) is not 1 then the Legendre and Jacobi symbols are put to 0. Therefore T(0, prime(n)) = 0, for n >= 1.
%C Because for GCD(-a,prime(n)) = 1 and for n >= 2 the Legendre symbol is (-a)^((prime(n)-1)/2) (mod prime(n)), it is sufficient to consider a = 0 .. prime(n) - 1, due to periodicity.
%C Caution for n=1 (prime 2): Jacobi(-a/2) has period length 8: [0,1,0,-1,0,-1,0,1]. Here row n = 1 is [0, 1]. For odd -m the solution of x^2 == -1 (mod 2) is x = 1 in the residue class {0,1} modulo 2. So -m is always a quadratic residue modulo 2 for odd m. This would lead to [repeat (0,1)] with period length 2.
%F T(n, m) = 0 if m = 0. T(n, m) = Legendre(-m, prime(n)) for m = 1, ..., prime(n)-1, n >= 2, and T(1, 1) = +1 (Jacobi symbol).
%e The irregular triangle T(n, m) begins (here P(n) = prime(n)):
%e n, P(n)\m 0 1 2 3 4 5 6 7 8 9 10 ...
%e 1, 2: 0 1
%e 2, 3: 0 -1 1
%e 3, 5: 0 1 -1 -1 1
%e 4, 7: 0 -1 -1 1 -1 1 1
%e 5, 11: 0 -1 1 -1 -1 -1 1 1 1 -1 1
%e ...
%e Row n=6, P(6)=13: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
%e Row n=7, P(7)=17: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
%e Row n=8, P(8)=19: 0 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1.
%e ...
%Y Cf. A000040, A226520.
%K sign,tabf
%O 1
%A _Wolfdieter Lang_, Feb 29 2016
|