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.

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.

This page as a plain text file.
%I A242869 #23 Jun 08 2014 13:56:33
%S A242869 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,
%T A242869 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,
%U A242869 1,4,1,2,1,0,9,2,1,4,1,2,1,0,1,2,1,0,21
%N 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.
%C A242869 The prefix and the suffix are allowed to overlap.
%C A242869 a(n) <= A147755(n).
%C A242869 a(2^n) = 0.
%C A242869 a(2^n-1) = 2^(n-1)-1 for n>0.
%C A242869 a(n) = 0 iff n in { A091065 }.
%C A242869 a(n) > 1 iff n in { A091066 }.
%C A242869 A029837(a(n)+1) = A091064(n).
%H A242869 Alois P. Heinz, <a href="/A242869/b242869.txt">Table of n, a(n) for n = 0..8192</a>
%e A242869 a(91) = 11 because 91 = (1011)011_2 = 101(1011)_2 and 11 = 1011_2.
%e A242869 a(84) = 0 because 84 = 1010100_2, only the empty bitstring is a proper prefix and suffix.
%p A242869 a:= proc(n) local m; m:=n;
%p A242869       while m>1 do m:= iquo(m, 2);
%p A242869         if m=irem(n, 2^(1+ilog2(m))) then return m fi
%p A242869       od; 0
%p A242869     end:
%p A242869 seq(a(n), n=0..100);
%Y A242869 Cf. A147755.
%K A242869 nonn,base,look
%O A242869 0,8
%A A242869 _Alois P. Heinz_, May 24 2014