login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A140820
Triangle read by rows: T(n,k) = 1 if and only if the Gray codes for n and k have no bits in common.
2
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, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0
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, ...}.
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
Sequence in context: A176918 A176890 A164057 * A275661 A266716 A190242
KEYWORD
nonn,tabl,less
AUTHOR
EXTENSIONS
Edited by G. C. Greubel, May 30 2019
New title from Charlie Neder, Jun 03 2019
STATUS
approved