login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; table; graph; refs; listen; history; text; internal format)
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
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)