login
A331047
T(n,k) = -(-1)^k*ceiling(k/2)^2 mod p, where p is the n-th prime congruent to 2 or 3 mod 4; triangle T(n,k), n>=1, 0<=k<=p-1, read by rows.
2
0, 1, 0, 1, 2, 0, 1, 6, 4, 3, 2, 5, 0, 1, 10, 4, 7, 9, 2, 5, 6, 3, 8, 0, 1, 18, 4, 15, 9, 10, 16, 3, 6, 13, 17, 2, 11, 8, 7, 12, 5, 14, 0, 1, 22, 4, 19, 9, 14, 16, 7, 2, 21, 13, 10, 3, 20, 18, 5, 12, 11, 8, 15, 6, 17, 0, 1, 30, 4, 27, 9, 22, 16, 15, 25, 6, 5
OFFSET
1,5
COMMENTS
Row n is a permutation of {0, 1, ..., A045326(n)-1}.
LINKS
EXAMPLE
Triangle T(n,k) begins:
0, 1;
0, 1, 2;
0, 1, 6, 4, 3, 2, 5;
0, 1, 10, 4, 7, 9, 2, 5, 6, 3, 8;
0, 1, 18, 4, 15, 9, 10, 16, 3, 6, 13, 17, 2, 11, 8, 7, 12, 5, 14;
...
MAPLE
b:= proc(n) option remember; local p;
p:= 1+`if`(n=1, 1, b(n-1));
while irem(p, 4)<2 do p:= nextprime(p) od; p
end:
T:= n-> (p-> seq(modp(-(-1)^k*ceil(k/2)^2, p), k=0..p-1))(b(n)):
seq(T(n), n=1..8);
MATHEMATICA
b[n_] := b[n] = Module[{p}, p = 1+If[n == 1, 1, b[n-1]]; While[Mod[p, 4]<2, p = NextPrime[p]]; p];
T[n_] := With[{p = b[n]}, Table[Mod[-(-1)^k*Ceiling[k/2]^2, p], {k, 0, p-1}]];
Table[T[n], {n, 1, 8}] // Flatten (* Jean-François Alcover, Oct 29 2021, after Alois P. Heinz *)
CROSSREFS
Columns k=0-2 give: A000004, A000012, A281664 (for n>1).
Last elements of rows give A190105(n-1) for n>1.
Row lengths give A045326.
Row sums give A000217(A281664(n)).
Sequence in context: A323837 A114709 A293147 * A264550 A089949 A085845
KEYWORD
nonn,look,tabf
AUTHOR
Alois P. Heinz, Jan 08 2020
STATUS
approved