OFFSET
1,5
COMMENTS
The sum of each row is n.
LINKS
Jason Bard, Table of n, a(n) for n = 1..11325
EXAMPLE
Triangle starts:
1
1 1
1 2 0
2 2 0 0
1 2 0 0 2
1 2 0 1 2 0
1 2 2 0 2 0 0
2 4 0 0 2 0 0 0
3 2 0 0 2 0 0 2 0
1 2 0 0 2 1 2 0 0 2
...
MATHEMATICA
dat[n_] := Table[Reduce[Mod[x^2, n] == k, x, Integers], {k, 0, n - 1}]; countConditions[cond_] := Which[cond === False, 0, MatchQ[cond, x \[Element] Integers], 1, True, Length@Cases[cond, Equal[x, _], Infinity]]; counts = Flatten[Table[countConditions /@ dat[n], {n, 1, 20}]]
PROG
(PARI) T(n, k) = sum(i=1, n, Mod(i, n)^2 == k);
row(n) = vector(n, i, T(n, i-1)); \\ Michel Marcus, Jun 23 2025
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Jason Bard, Jun 18 2025
STATUS
approved
