A143541 Triangle read by rows, T(n,k) = 1 if both n and k are prime, 0 otherwise; 1 <= k <= n.
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
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.
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..1275(rows n=1..50)
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.
Comments