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.

A143541 Triangle read by rows, T(n,k) = 1 if both n and k are prime, 0 otherwise; 1 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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

Row sums = the prime count, A049084: (0, 1, 2, 0, 3, 0, 4, 0, 0, 0, 5, ...).

Examples

			First few rows of the triangle are:
  0;
  0, 1;
  0, 1, 1;
  0, 0, 0, 0;
  0, 1, 1, 0, 1;
  0, 0, 0, 0, 0, 0;
  0, 1, 1, 0, 1, 0, 1;
  ...
Row 5 = first 5 terms of A010051: (0, 1, 1, 0, 1).
T(5,3) = 1 since (5,3) are prime; but T(5,4) = 0 since 4 is a nonprime.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->`if`(isprime(n) and isprime(k),1,0): seq(seq(T(n,k),k=1..n),n=1..12); # Muniru A Asiru, Oct 28 2018
  • Mathematica
    nn = 11; Flatten[Table[Table[If[And[PrimeQ[n], PrimeQ[k]], 1, 0], {k, 1, n}], {n, 1, nn}]] (* Mats Granvik, Oct 28 2018 *)

Formula

Triangle read by rows, T(n,k) = 1 if n & k are prime, 0 otherwise.
The n-th row = n zeros if n is a nonprime; first n terms of A010051 (the characteristic function of primes) if n is prime.