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.

A049759 Triangular array T read by rows: T(n,k)=n^2 mod k, for k=1,2,...,n, n=1,2,...

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 4, 1, 0, 0, 0, 1, 0, 4, 4, 1, 0, 0, 1, 0, 1, 1, 3, 4, 1, 0, 0, 0, 1, 0, 0, 4, 2, 4, 1, 0, 0, 1, 1, 1, 1, 1, 2, 1, 4, 1, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 1, 0, 0, 1, 1, 1, 4, 1, 1, 1, 7, 9, 4, 1, 0
Offset: 1

Views

Author

Keywords

Examples

			Triangle begins:
  0;
  0, 0;
  0, 1, 0;
  0, 0, 1, 0;
  0, 1, 1, 1, 0;
  0, 0, 0, 0, 1, 0;
  0, 1, 1, 1, 4, 1, 0;
  0, 0, 1, 0, 4, 4, 1, 0;
  0, 1, 0, 1, 1, 3, 4, 1, 0;
  0, 0, 1, 0, 0, 4, 2, 4, 1, 0;
  0, 1, 1, 1, 1, 1, 2, 1, 4, 1, 0;
  0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 1, 0;
  0, 1, 1, 1, 4, 1, 1, 1, 7, 9, 4, 1, 0;
		

Crossrefs

Cf. A048152.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> PowerMod(n,2,k) ))); # G. C. Greubel, Dec 13 2019
  • Magma
    [[Modexp(n,2,k): k in [1..n]]: n in [1..15]]; // G. C. Greubel, Dec 13 2019
    
  • Maple
    seq(seq( `mod`(n^2, k), k = 1..n), n = 1..15); # G. C. Greubel, Dec 13 2019
  • Mathematica
    Table[PowerMod[n,2,k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 13 2019 *)
  • PARI
    tabl(nn) = {for (n=1, nn, for (k=1, n, print1(n^2 % k, ", ");); print(););} \\ Michel Marcus, Mar 31 2014
    
  • Sage
    [[power_mod(n,2,k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 13 2019