cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A331103 T(n,k) = -(-1)^k*k^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.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 1, 3, 2, 5, 4, 6, 0, 1, 7, 9, 6, 3, 8, 5, 2, 4, 10, 0, 1, 15, 9, 3, 6, 2, 11, 12, 5, 14, 7, 8, 17, 13, 16, 10, 4, 18, 0, 1, 19, 9, 7, 2, 10, 3, 5, 12, 15, 6, 17, 8, 11, 18, 20, 13, 21, 16, 14, 4, 22, 0, 1, 27, 9, 15, 25, 26, 18, 29, 19, 24
Offset: 1

Views

Author

Alois P. Heinz, Jan 09 2020

Keywords

Comments

Row n is a permutation of {0, 1, ..., A045326(n)-1}.

Examples

			Triangle T(n,k) begins:
  0, 1;
  0, 1,  2;
  0, 1,  3, 2, 5, 4, 6;
  0, 1,  7, 9, 6, 3, 8,  5,  2, 4, 10;
  0, 1, 15, 9, 3, 6, 2, 11, 12, 5, 14, 7, 8, 17, 13, 16, 10, 4, 18;
  ...
		

Crossrefs

Columns k=0-1 give: A000004, A000012.
Last elements of rows give A281664.
Row lengths give A045326.
Row sums give A000217(A281664(n)).
Cf. A331047.

Programs

  • 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*k^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*k^2, p], {k, 0, p - 1}]];
    Table[T[n], {n, 1, 8}] // Flatten (* Jean-François Alcover, Oct 29 2021, after Alois P. Heinz *)
Showing 1-1 of 1 results.