OFFSET
1,1
COMMENTS
EXAMPLE
The tenth row gives the quadratic residues and non-residues of 11 (see A011582) and the twelfth row gives the same information for 13 (A011583), with -1's replaced by zeros.
.
Triangle starts:
[ 1] [1]
[ 2] [1, 0]
[ 3] [1, 0, 0]
[ 4] [1, 0, 0, 1]
[ 5] [1, 0, 1, 1, 0]
[ 6] [1, 1, 0, 1, 0, 0]
[ 7] [1, 0, 0, 1, 0, 0, 0]
[ 8] [1, 0, 0, 1, 0, 0, 1, 0]
[ 9] [1, 0, 0, 1, 1, 1, 0, 0, 1]
[10] [1, 0, 1, 1, 1, 0, 0, 0, 1, 0]
[11] [1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
[12] [1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1]
MAPLE
# See A054431 for one_or_zero and trinv.
with(numtheory, quadres); quadres_0_1_array := (n) -> one_or_zero(quadres((n-((trinv(n-1)*(trinv(n-1)-1))/2)), (trinv(n-1)+1)));
MATHEMATICA
row[n_] := With[{rr = Table[Mod[k^2, n + 1], {k, 1, n}] // Union}, Boole[ MemberQ[rr, #]]& /@ Range[n]];
Array[row, 14] // Flatten (* Jean-François Alcover, Mar 05 2016 *)
PROG
(Sage)
def A055088_row(n) :
Q = quadratic_residues(n+1)
return [int(i in Q) for i in (1..n)]
for n in (1..14) : print(A055088_row(n)) # Peter Luschny, Aug 08 2012
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Apr 18 2000
STATUS
approved