A242869 Largest integer m < n having a binary expansion that is a prefix and a suffix of the binary expansion of n; a(0)=0.
0, 0, 0, 1, 0, 1, 0, 3, 0, 1, 2, 1, 0, 1, 0, 7, 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 0, 3, 0, 1, 0, 15, 0, 1, 2, 1, 4, 1, 2, 1, 0, 1, 10, 1, 0, 5, 2, 1, 0, 1, 0, 3, 0, 1, 6, 3, 0, 1, 0, 3, 0, 1, 0, 31, 0, 1, 2, 1, 4, 1, 2, 1, 0, 9, 2, 1, 4, 1, 2, 1, 0, 1, 2, 1, 0, 21
Offset: 0
Examples
a(91) = 11 because 91 = (1011)011_2 = 101(1011)_2 and 11 = 1011_2. a(84) = 0 because 84 = 1010100_2, only the empty bitstring is a proper prefix and suffix.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..8192
Crossrefs
Cf. A147755.
Programs
-
Maple
a:= proc(n) local m; m:=n; while m>1 do m:= iquo(m, 2); if m=irem(n, 2^(1+ilog2(m))) then return m fi od; 0 end: seq(a(n), n=0..100);
Comments