This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A131218 #31 Sep 06 2025 15:43:42 %S A131218 1,1,1,1,0,1,1,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0, %T A131218 0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,0,0,0,1,1,0,1,1,0, %U A131218 0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1 %N A131218 Array read by antidiagonals: A(n, k) = 1 if and only if the Gray codes for n and k have no bits in common. %H A131218 G. C. Greubel, <a href="/A131218/b131218.txt">Antidiagonals n = 0..100, flattened</a> %F A131218 A(n,k) = A(k,n) = A140820(n,k) for k <= n. %e A131218 Array, A(n, k), begins as: %e A131218 1, 1, 1, 1, 1, 1, 1, 1, 1, ...; %e A131218 1, 0, 0, 1, 1, 0, 0, 1, 1, ...; %e A131218 1, 0, 0, 0, 0, 0, 0, 1, 1, ...; %e A131218 1, 1, 0, 0, 0, 0, 1, 1, 1, ...; %e A131218 1, 1, 0, 0, 0, 0, 0, 0, 0, ...; %e A131218 1, 0, 0, 0, 0, 0, 0, 0, 0, ...; %e A131218 1, 0, 0, 1, 0, 0, 0, 0, 0, ...; %e A131218 1, 1, 1, 1, 0, 0, 0, 0, 0, ...; %e A131218 1, 1, 1, 1, 0, 0, 0, 0, 0, ...; %e A131218 ... %e A131218 Antidiagonals begin as: %e A131218 1; %e A131218 1, 1; %e A131218 1, 0, 1; %e A131218 1, 0, 0, 1; %e A131218 1, 1, 0, 1, 1; %e A131218 1, 1, 0, 0, 1, 1; %e A131218 1, 0, 0, 0, 0, 0, 1; %e A131218 1, 0, 0, 0, 0, 0, 0, 1; %e A131218 1, 1, 0, 0, 0, 0, 0, 1, 1; %e A131218 1, 1, 1, 1, 0, 0, 1, 1, 1, 1; %e A131218 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1; %e A131218 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1; %e A131218 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1; %e A131218 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1; %e A131218 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1; %e A131218 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1; %e A131218 ... %t A131218 A131218[n_, k_]:= Boole[BitAnd[BitXor[n, BitShiftRight[n,1]], BitXor[k, BitShiftRight[k,1]]]==0]; (* based on _Kevin Ryde_'s code of A140820 *) %t A131218 Table[A131218[n-k, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Sep 04 2025 *) %o A131218 (Magma) %o A131218 A131218:= func< n,k | BitwiseAnd(BitwiseXor(n, ShiftRight(n, 1)), BitwiseXor(k, ShiftRight(k, 1))) eq 0 select 1 else 0 >; // based on _Kevin Ryde_'s code of A140820 %o A131218 [A131218(n-k,k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Sep 04 2025 %o A131218 (PARI) A(n, k) = !bitand(bitxor(n, n>>1), bitxor(k, k>>1)); \\ _Joerg Arndt_, Sep 05 2025 %o A131218 (SageMath) %o A131218 def A131218(n,k): return int( (n^^(n>>1)) & (k^^(k>>1)) ==0) # based on _Kevin Ryde_'s code of A140820 %o A131218 print(flatten([[A131218(n-k, k) for k in range(n+1)] for n in range(13)])) # _G. C. Greubel_, Sep 05 2025 %Y A131218 Cf. A140820 (lower triangle), A363710 (antidiagonal sums). %K A131218 nonn,tabl,less,changed %O A131218 0,1 %A A131218 _Roger L. Bagula_, Sep 27 2007 %E A131218 Edited by and new name from _G. C. Greubel_, Sep 04 2025