login
A268921
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.
1
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, 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, 1, 1, 0, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1
OFFSET
1
COMMENTS
Row n has length prime(n) = A000040(n).
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.
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.
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.
FORMULA
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).
EXAMPLE
The irregular triangle T(n, k) begins (here P(n) = prime(n)):
n, P(n) \k 0 1 2 3 4 5 6 7 8 9 10 ...
1, 2: 0 1
2, 3: 0 -1 1
3, 5: 0 1 -1 -1 1
4, 7: 0 -1 -1 1 -1 1 1
5, 11: 0 -1 1 -1 -1 -1 1 1 1 -1 1
6, 13: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
7, 17: 0 1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1;
8, 19: 0 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1;
...
MATHEMATICA
With[{P=Prime[n]}, Table[JacobiSymbol[-k, P], {n, 15}, {k, 0, P-1}]]//Flatten (* G. C. Greubel, Oct 05 2024 *)
PROG
(Magma)
A268921:= func< n, k | n eq 1 select k else JacobiSymbol(-k, NthPrime(n)) >;
[A268921(n, k) : k in [0..NthPrime(n)-1], n in [1..15]]; // G. C. Greubel, Oct 05 2024
(SageMath)
def A268921(n, k): return k if n==1 else jacobi_symbol(-k, nth_prime(n))
flatten([[A268921(n, k) for k in range(nth_prime(n))] for n in range(1, 16)]) # G. C. Greubel, Oct 05 2024
CROSSREFS
Sequence in context: A373223 A023532 A226520 * A327180 A030308 A280237
KEYWORD
sign,tabf
AUTHOR
Wolfdieter Lang, Feb 29 2016
STATUS
approved