OFFSET
1,1
COMMENTS
Old title was: "Let c(j, k) = (floor(j/2^k) mod 2) and b(j, k) = if( c(j, k) = 0 and c(j, k+1) = 0 then 0 else if(c(j, k) = 1 and c(j, k+1) = 1 then 0 else 1)) then the triangle is generated by T(n, k) = if( Sum_{j=0..n} b(n, j)* b(k, j) = 0 then 1 else 0)."
Row sums are {1, 1, 1, 2, 2, 1, 2, 4, 4, 2, 1, 2, 4, 2, 4, 8, 8, ...}.
LINKS
G. C. Greubel, Rows n = 1..100 of triangle, flattened
FORMULA
Let c(j, k) = (floor(j/2^k) mod 2) and b(j, k) = if( c(j, k) = 0 and c(j, k+1) = 0 then 0 else if(c(j, k) = 1 and c(j, k+1) = 1 then 0 else 1)) then the triangle is generated by T(n, k) = if( Sum_{j=0..n} b(n, j)* b(k, j) = 0 then 1 else 0).
EXAMPLE
Triangle begins as:
1;
1, 0;
1, 0, 0;
1, 1, 0, 0;
1, 1, 0, 0, 0;
1, 0, 0, 0, 0, 0;
1, 0, 0, 1, 0, 0, 0;
1, 1, 1, 1, 0, 0, 0, 0;
1, 1, 1, 1, 0, 0, 0, 0, 0;
1, 0, 0, 1, 0, 0, 0, 0, 0, 0;
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
MATHEMATICA
n=16; c[i_, k_]:= Mod[Floor[i/2^k], 2]; b[i_, k_]:= If[c[i, k]==0 && c[i, k+1]==0, 0, If[c[i, k]==1 && c[i, k+1]==1, 0, 1]]; Table[If[Sum[b[i, k]* b[j, k], {k, 0, n}]==0, 1, 0], {i, 0, n}, {j, 0, i} ]//Flatten (* modified by G. C. Greubel, May 30 2019 *)
PROG
(PARI)
c(j, k) = Mod((j/2^k)\1, 2);
b(j, k) = if(c(j, k)==0 && c(j, k+1)==0, 0, if(c(j, k)==1 && c(j, k+1)==1, 0, 1));
for(k=0, 16, for(s=0, k, print1(if(sum(r=0, k, b(k, r)*b(s, r))==0, 1, 0), ", "))) \\ G. C. Greubel, Jun 03 2019
(PARI) T(n, k) = !bitand(bitxor(n, n>>1), bitxor(k, k>>1)); \\ Kevin Ryde, Jul 13 2020
(Sage)
def c(j, k): return Mod(floor(j/2^k), 2)
def b(j, k):
if (c(j, k)==0 and c(j, k+1)==0): return 0
elif (c(j, k)==1 and c(j, k+1)==1): return 0
else: return 1
def T(n, k):
if (sum(b(n, r)*b(k, r) for r in (0..n))==0): return 1
else: return 0
[[T(n, k) for k in (0..n)] for n in (0..16)] # G. C. Greubel, Jun 03 2019
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula and Gary W. Adamson, Oct 17 2008
EXTENSIONS
Edited by G. C. Greubel, May 30 2019
New title from Charlie Neder, Jun 03 2019
STATUS
approved