A047886 Triangle read by rows: T(n,k) = pi(n+k) - pi(n) - pi(k), where pi() = A000720 (n >= 0, 0 <= k <= n).
0, 0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, -1, -1, -2, 0, 1, 0, -1, -1, -1, -1, 0, 0, -1, -2, -1, -2, -1, -2, 0, 0, -1, -1, -1, -1, -1, -2, -2, 0, 0, 0, -1, 0, -1, -1, -2, -1, -1, 0, 1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -2, -1, -2, -1, -1, -1, -2, 0, 1, 0, -1
Offset: 0
Examples
Triangle begins 0; 0, 1; 0, 1, 0; 0, 0, 0, -1; 0, 1, 0, 0, 0; 0, 0, 0, -1, -1, -2; ...
Programs
-
Mathematica
Flatten[Table[PrimePi[n+k]-PrimePi[n]-PrimePi[k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Feb 22 2012 *)
Extensions
More terms from James Sellers, Dec 22 1999
Comments