OFFSET
0,43
COMMENTS
We call PS the 'protosymbol' because various classic symbols can be easily obtained from it, such as the Legendre, the Jacobi and the Kronecker symbol.
For example, to use the Legendre symbol, you can define it as follows: LS(n/p) = PS(n, p) if n > 0 and p is prime and p > 2 and n mod p != 0. Otherwise, it is "not defined". From this viewpoint, the Legendre symbol can be seen as a filter applied to PS, excluding the cases that Legendre was not concerned with.
EXAMPLE
[ 0] 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
[ 2] 0, 1, 0, -1, 0, -1, 2, 1, 0, -2, 2, -1, ...
[ 3] 0, 1, 1, 0, 1, -1, 3, -1, 1, 0, 3, 1, ...
[ 4] 0, 1, 0, 1, 0, 1, -2, 1, 0, 4, 4, 1, ...
[ 5] 0, 1, 1, -1, 1, 0, -1, -1, 1, 4, 5, 1, ...
[ 6] 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, -4, -1, ...
[ 7] 0, 1, 1, 1, 1, -1, 1, 0, 1, -2, -3, -1, ...
[ 8] 0, 1, 0, -1, 0, -1, 2, 1, 0, 1, -2, -1, ...
[ 9] 0, 1, 1, 0, 1, 1, 3, 1, 1, 0, -1, 1, ...
[10] 0, 1, 0, 1, 0, 0, -2, -1, 0, 1, 0, -1, ...
[11] 0, 1, 1, -1, 1, 1, -1, 1, 1, -2, 1, 0, ...
MAPLE
PS := (n, k) -> if n = 1 or k = 1 then 1
elif n = 0 or k = 0 then 0
else mods(n &^ iquo(k, 2), k) fi:
for n from 0 to 11 do seq(PS(n, k), k = 0..11) od;
PROG
(Python)
def PS(n, k):
if n == 1 or k == 1: return 1
if n == 0 or k == 0: return 0
m = pow(n, k // 2, k)
if k // 2 < m: m -= k
return m
for n in range(12): print([PS(n, k) for k in range(12)])
CROSSREFS
KEYWORD
sign,tabl
AUTHOR
Peter Luschny, Jul 08 2024
STATUS
approved