login
A226520
Irregular triangle read by rows: T(n,k) = Legendre(k,prime(n)), for 0 <= k < prime(n).
7
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
Strictly speaking, the symbol in the definition is the Legendre-Jacobi-Kronecker symbol, since the Legendre symbol is defined only for odd primes.
REFERENCES
R. Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 289.
József Beck, Inevitable randomness in discrete mathematics, University Lecture Series, 49. American Mathematical Society, Providence, RI, 2009. xii+250 pp. ISBN: 978-0-8218-4756-5; MR2543141 (2010m:60026). See page 23.
H. Cohen, A Course in Computational Alg. No. Theory, Springer, 1993, p. 28.
LINKS
D. A. Burgess, The distribution of quadratic residues and non-residues, Mathematika 4, 1957, 106--112. MR0093504 (20 #28)
Wikipedia, Legendre symbol.
FORMULA
See A226518 for bounds.
EXAMPLE
Triangle begins
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;
...
MAPLE
with(numtheory);
T:=(n, k)->legendre(k, ithprime(n));
f:=n->[seq(T(n, k), k=0..ithprime(n)-1)];
[seq(f(n), n=1..15)];
MATHEMATICA
Table[p = Prime[n]; Table[JacobiSymbol[k, p], {k, 0, p-1}], {n, 15}]//Flatten (* Jean-François Alcover, Mar 07 2014 *)
PROG
(Haskell)
a226520 n k = a226520_tabf !! (n-1) !! k
a226520_row n = a226520_tabf !! (n-1)
a226520_tabf =
map (\p -> map (flip legendreSymbol p) [0..p-1]) a000040_list
-- where the function legendreSymbol is defined in A097343.
-- Reinhard Zumkeller, Feb 02 2014
(Magma)
A226520:= func< n, k | n eq 1 select k else JacobiSymbol(k, NthPrime(n)) >;
[A226520(n, k) : k in [0..NthPrime(n)-1], n in [1..12]]; // G. C. Greubel, Oct 05 2024
(SageMath)
def A226520(n, k): return k if n==1 else jacobi_symbol(k, nth_prime(n))
flatten([[A226520(n, k) for k in range(nth_prime(n))] for n in range(1, 12)]) # G. C. Greubel, Oct 05 2024
CROSSREFS
Row sums give A226518.
See A097343 for another version.
Sequence in context: A157412 A373223 A023532 * A268921 A327180 A030308
KEYWORD
sign,tabf
AUTHOR
N. J. A. Sloane, Jun 19 2013
STATUS
approved