Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Oct 06 2024 09:15:28
%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 read by rows: T(n, k) = Legendre symbol (-k / prime(n)) for k = 0, ..., prime(n)-1, for n >= 1, with T(n, 0) = 0, T(1, 1) = 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.
%H G. C. Greubel, <a href="/A268921/b268921.txt">Rows n = 1..50 of the irregular triangle, flattened</a>
%F T(n, k) = Legendre(-k, prime(n)) for 1 <= k <= prime(n) - 1, n >= 2, and T(n, 0) = 0, T(1, 1) = +1 (Jacobi symbol).
%e The irregular triangle T(n, k) begins (here P(n) = prime(n)):
%e n, P(n) \k 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 6, 13: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
%e 7, 17: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
%e 8, 19: 0 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1;
%e ...
%t With[{P=Prime[n]}, Table[JacobiSymbol[-k,P], {n,15}, {k,0,P-1}]]//Flatten (* _G. C. Greubel_, Oct 05 2024 *)
%o (Magma)
%o A268921:= func< n,k | n eq 1 select k else JacobiSymbol(-k, NthPrime(n)) >;
%o [A268921(n,k) : k in [0..NthPrime(n)-1], n in [1..15]]; // _G. C. Greubel_, Oct 05 2024
%o (SageMath)
%o def A268921(n,k): return k if n==1 else jacobi_symbol(-k, nth_prime(n))
%o flatten([[A268921(n,k) for k in range(nth_prime(n))] for n in range(1,16)]) # _G. C. Greubel_, Oct 05 2024
%Y Cf. A000040, A226520.
%K sign,tabf
%O 1
%A _Wolfdieter Lang_, Feb 29 2016