cp's OEIS Frontend

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.

A327188 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the greatest possible value of x AND y (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A327188 #13 Aug 26 2019 16:30:01
%S A327188 0,0,0,1,0,1,0,1,0,1,2,2,0,1,2,3,0,1,2,2,0,1,2,2,0,1,2,3,0,1,2,3,0,1,
%T A327188 2,2,4,4,4,4,0,1,2,2,4,5,4,5,0,1,2,3,4,4,6,6,0,1,2,3,4,5,6,7,0,1,2,2,
%U A327188 4,4,4,4,0,1,2,2,4,4,4,4,0,1,2,2,4,5,4
%N A327188 For any n >= 0: consider the different ways to split the binary representation of n into two (possibly empty) parts, say with value x and y; a(n) is the greatest possible value of x AND y (where AND denotes the bitwise AND operator).
%C A327188 The first 10000 positive integers where the sequence equals zero match the first 10000 terms of A082662; is that true forever?
%H A327188 Rémy Sigrist, <a href="/A327188/b327188.txt">Table of n, a(n) for n = 0..8192</a>
%e A327188 For n=42:
%e A327188 - the binary representation of 42 is "101010",
%e A327188 - there are 7 ways to split it:
%e A327188    - "" and "101010": x=0 and y=42: 0 AND 42 = 0,
%e A327188    - "1" and "01010": x=1 and y=10: 1 AND 10 = 0,
%e A327188    - "10" and "1010": x=2 and y=10: 2 AND 10 = 2,
%e A327188    - "101" and "010": x=5 and y=2: 5 AND 2 = 0,
%e A327188    - "1010" and "10": x=10 and y=2: 10 AND 2 = 2,
%e A327188    - "10101" and "0": x=21 and y=0: 21 AND 0 = 0,
%e A327188    - "101010" and "": x=42 and y=0: 42 AND 0 = 0,
%e A327188 - hence a(42) = 2.
%o A327188 (PARI) a(n) = my (v=-oo, b=binary(n)); for (w=0, #b, v=max(v, bitand(fromdigits(b[1..w],2), fromdigits(b[w+1..#b],2)))); v
%Y A327188 See A327186 for other variants.
%Y A327188 Cf. A082662.
%K A327188 nonn,look,base
%O A327188 0,11
%A A327188 _Rémy Sigrist_, Aug 25 2019