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.

A143538 Triangle read by rows, T(n,k) = 1 if k is prime, 0 otherwise; 1 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Comments

Triangle read by rows, T(n,k) = 1 if k is prime, 0 otherwise; 1 <= k <= n. A000012 * (A010051 * 0^(n-k)). A010051 * 0^(n-k) = an infinite lower triangular matrix with A010051 (the characteristic function of the primes) as the main diagonal and the rest zeros. The multiplier A000012 takes partial sums of column terms.

Examples

			First few rows of the triangle =
0;
0, 1;
0, 1, 1;
0, 1, 1, 0;
0, 1, 1, 0, 1;
0, 1, 1, 0, 1, 0;
0, 1, 1, 0, 1, 0, 1;
...
		

Crossrefs

Cf. A000720 (row sums), A002260, A010051.

Programs

  • Mathematica
    Table[If[PrimeQ[k], 1, 0], {n, 1, 20}, {k, 1, n}] // Flatten (* G. C. Greubel, Sep 17 2017 *)
  • PARI
    for(n=1,10, for(k=1,n, print1(if(isprime(k),1,0), ", "))) \\ G. C. Greubel, Sep 17 2017

Formula

a(n) = A010051(A002260(n)). - Wesley Ivan Hurt, Sep 20 2021