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.

A173655 Triangle read by rows: T(n,k) = prime(n) mod prime(k), 0 < k <= n.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 4, 0, 1, 1, 3, 6, 2, 0, 1, 2, 2, 3, 6, 4, 0, 1, 1, 4, 5, 8, 6, 2, 0, 1, 2, 3, 2, 1, 10, 6, 4, 0, 1, 2, 4, 1, 7, 3, 12, 10, 6, 0, 1, 1, 1, 3, 9, 5, 14, 12, 8, 2, 0, 1, 1, 2, 2, 4, 11, 3, 18, 14, 8, 6, 0, 1, 2, 1, 6, 8, 2, 7, 3, 18, 12, 10, 4, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 24 2010

Keywords

Examples

			Triangle begins as:
  0;
  1, 0;
  1, 2, 0;
  1, 1, 2, 0;
  1, 2, 1, 4, 0;
  1, 1, 3, 6, 2,  0;
  1, 2, 2, 3, 6,  4,  0;
  1, 1, 4, 5, 8,  6,  2,  0;
  1, 2, 3, 2, 1, 10,  6,  4, 0;
  1, 2, 4, 1, 7,  3, 12, 10, 6, 0;
		

Crossrefs

Cf. A001223 (2nd diagonal), A033955 (row sums), A102647 (row products excluding 0's), A031131 (3rd diagonal after first 3 terms).

Programs

  • Magma
    A173655:= func< n,k | NthPrime(n) mod NthPrime(k) >;
    [A173655(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 10 2024
    
  • Maple
    A173655 := proc(n,k) ithprime(n) mod ithprime(k) ;end proc:
    seq(seq(A173655(n,k),k=1..n),n=1..20) ; # R. J. Mathar, Nov 24 2010
  • Mathematica
    Flatten[Table[Mod[Prime[n], Prime[Range[n]]], {n, 15}]]
  • PARI
    forprime(p=2,40,forprime(q=2,p,print1(p%q", "))) \\ Charles R Greathouse IV, Dec 21 2011
    
  • SageMath
    def A173655(n,k): return nth_prime(n)%nth_prime(k)
    flatten([[A173655(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Apr 10 2024