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.

This page as a plain text file.
%I A143541 #20 Nov 14 2018 13:58:30
%S A143541 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,
%T A143541 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
%N A143541 Triangle read by rows, T(n,k) = 1 if both n and k are prime, 0 otherwise; 1 <= k <= n.
%C A143541 Row sums = the prime count, A049084: (0, 1, 2, 0, 3, 0, 4, 0, 0, 0, 5, ...).
%H A143541 Muniru A Asiru, <a href="/A143541/b143541.txt">Table of n, a(n) for n = 1..1275</a>(rows n=1..50)
%F A143541 Triangle read by rows, T(n,k) = 1 if n & k are prime, 0 otherwise.
%F A143541 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.
%e A143541 First few rows of the triangle are:
%e A143541   0;
%e A143541   0, 1;
%e A143541   0, 1, 1;
%e A143541   0, 0, 0, 0;
%e A143541   0, 1, 1, 0, 1;
%e A143541   0, 0, 0, 0, 0, 0;
%e A143541   0, 1, 1, 0, 1, 0, 1;
%e A143541   ...
%e A143541 Row 5 = first 5 terms of A010051: (0, 1, 1, 0, 1).
%e A143541 T(5,3) = 1 since (5,3) are prime; but T(5,4) = 0 since 4 is a nonprime.
%p A143541 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
%t A143541 nn = 11; Flatten[Table[Table[If[And[PrimeQ[n], PrimeQ[k]], 1, 0], {k, 1, n}], {n, 1, nn}]] (* _Mats Granvik_, Oct 28 2018 *)
%Y A143541 Cf. A010051, A049084.
%K A143541 nonn,tabl
%O A143541 1,1
%A A143541 _Gary W. Adamson_, Aug 23 2008