login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A372726 Legendre's triangle read by rows. T(n, k) = L(n / prime(k)) where L(n/p) is the Legendre symbol, for n >= 0 and 2 <= k <= n + 2. 5
0, 1, 1, -1, -1, 1, 0, -1, -1, 1, 1, 1, 1, 1, 1, -1, 0, -1, 1, -1, -1, 0, 1, -1, -1, -1, -1, 1, 1, -1, 0, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 0, -1, -1, 1, -1, -1 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
0
LINKS
Adrien Marie Legendre, Essai sur la théorie des nombres, Paris, Duprat, an VI [1798]. Introducing the symbol, p. 186.
FORMULA
T(n, k) = r - p*[r > 1] where r = n^v mod p, p = prime(k), v = (p - 1)/2, and [.] are the Iverson brackets.
EXAMPLE
Triangle starts:
[ 0] 0;
[ 1] 1, 1;
[ 2] -1, -1, 1;
[ 3] 0, -1, -1, 1;
[ 4] 1, 1, 1, 1, 1;
[ 5] -1, 0, -1, 1, -1, -1;
[ 6] 0, 1, -1, -1, -1, -1, 1;
[ 7] 1, -1, 0, -1, -1, -1, 1, -1;
[ 8] -1, -1, 1, -1, -1, 1, -1, 1, -1;
[ 9] 0, 1, 1, 1, 1, 1, 1, 1, 1, 1;
[10] 1, 0, -1, -1, 1, -1, -1, -1, -1, 1, 1;
.
Not limiting the range of k leads to the square array:
3, 5, 7, 11, 13, 17, 19, 23, 29, 31
-----------------------------------------------
[0] 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[1] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
[2] -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, ...
[3] 0, -1, -1, 1, 1, -1, -1, 1, -1, -1, ...
[4] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
[5] -1, 0, -1, 1, -1, -1, 1, -1, 1, 1, ...
[6] 0, 1, -1, -1, -1, -1, 1, 1, 1, -1, ...
[7] 1, -1, 0, -1, -1, -1, 1, -1, 1, 1, ...
[8] -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, ...
[9] 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
...
MAPLE
L := (n, k) -> NumberTheory:-LegendreSymbol(n, ithprime(k)):
for n from 0 to 10 do lprint([n], seq(L(n, k), k = 2..n + 2)) od;
PROG
(Python)
from sympy import primerange, prime, legendre_symbol
for n in range(11):
print([n], [legendre_symbol(n, p) for p in primerange(3, prime(n + 2) + 1)])
# For illustration of the formula (Sympy's implementation is more efficent):
def LegendreSymbol(n, p):
v = (p - 1) // 2
res = pow(n, v, p)
return res - p if res > 1 else res
CROSSREFS
Family: A217831 (Euclid's triangle), A372877 (Jacobi's triangle), A372728 (Kronecker's triangle), A373223 (Gauss' triangle), A373751 (quadratic residue modulo prime(n)), A373748 (quadratic residue/nonresidue modulo n).
Cf. A372725 (row sums).
Sequence in context: A182067 A196147 A097325 * A242647 A167393 A275606
KEYWORD
sign,tabl,changed
AUTHOR
Peter Luschny, May 22 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 7 02:08 EDT 2024. Contains 374061 sequences. (Running on oeis4.)