A154721 Triangle read by rows in which row n lists 2n-1 terms: The pairs of noncomposite numbers equidistant to n, with 0's inserted, as shown below in the example.
0, 1, 0, 3, 1, 0, 0, 0, 5, 1, 0, 3, 0, 5, 0, 7, 0, 0, 3, 0, 0, 0, 7, 0, 0, 1, 0, 0, 0, 5, 0, 7, 0, 0, 0, 11, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 11, 0, 13, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 11, 0, 13, 0, 0, 1, 0, 0, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17
Offset: 1
Examples
Triangle begins: 0 1 0 3 1 0 0 0 5 1 0 3 0 5 0 7 0 0 3 0 0 0 7 0 0 1 0 0 0 5 0 7 0 0 0 11 1 0 3 0 0 0 0 0 0 0 11 0 13 0 0 3 0 5 0 0 0 0 0 11 0 13 0 0 1 0 0 0 5 0 7 0 0 0 11 0 13 0 0 0 17 1 0 3 0 0 0 7 0 0 0 0 0 13 0 0 0 17 0 19
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isnotcomp:=proc(n)return (n=1 or isprime(n)) end: for n from 1 to 10 do for k from 1 to 2*n-1 do if(not k=n and (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):else print(0):fi:od:od: # Nathaniel Johnston, Apr 18 2011
-
Mathematica
T[n_, k_] := If[k != n && !CompositeQ[k] && !CompositeQ[2n - k], k, 0]; Table[T[n, k], {n, 1, 10}, {k, 1, 2n - 1}] // Flatten (* Jean-François Alcover, Dec 04 2017 *)
Comments